Skip to content

Instantly share code, notes, and snippets.

@hedgejanuary
Created July 30, 2018 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hedgejanuary/2afd1078e66c438ddbe045738e461044 to your computer and use it in GitHub Desktop.
Save hedgejanuary/2afd1078e66c438ddbe045738e461044 to your computer and use it in GitHub Desktop.
This was my first code to calculate average score. - not working -
function averageScore(arr) {
var total;
for (var i = 0; i < arr.length; i++) {
total += arr[i];
}
return total / arr.length;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment