Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Loop function
function average(numbers) {
let total = 0;
for (let i = 0; i < numbers.length; i++) {
total += numbers[i];
}
return total / numbers.length;
}
function average(numbers) {
let total = 0;
for (let i =1; i < numbers.length; i++);
total + numbers.length;
return total / numbers.length;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.