Skip to content

Instantly share code, notes, and snippets.

@cesarkohl
Created January 13, 2020 14:27
Show Gist options
  • Select an option

  • Save cesarkohl/933fdf081d19f90b72c24f62e963e82b to your computer and use it in GitHub Desktop.

Select an option

Save cesarkohl/933fdf081d19f90b72c24f62e963e82b to your computer and use it in GitHub Desktop.
var numbers = [1,2,3,4,5];
var sum = 0;
for (var i = 0; i <numbers.length; i ++) {
 sum + = numbers [i];
}
console.log (sum); // 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment