Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created November 13, 2024 15:32
Show Gist options
  • Save dontpaniclabsgists/3c8b54bb6ff070b93f6d3b3b368cb436 to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/3c8b54bb6ff070b93f6d3b3b368cb436 to your computer and use it in GitHub Desktop.
let numbers: number[] = [85, 90, 78, 92, 88];
let total = 0;
let count = numbers.length;
for (let i = 0; i < count; i++) {
total += numbers[i];
}
let average = total / count;
console.log("Average:", average); //Output is 86.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment