Created
November 13, 2024 15:34
-
-
Save dontpaniclabsgists/bd6c23293537b5783c4fac5c2e0e1623 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers: number[] = [85, 90, 78, 92, 88]; | |
let total = 0; | |
for (let index in numbers) { | |
total += numbers[index]; | |
} | |
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