Skip to content

Instantly share code, notes, and snippets.

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