Skip to content

Instantly share code, notes, and snippets.

@JohnMGant
Last active August 7, 2020 17:34
Show Gist options
  • Select an option

  • Save JohnMGant/d213cd97981c652757faa81544916b0e to your computer and use it in GitHub Desktop.

Select an option

Save JohnMGant/d213cd97981c652757faa81544916b0e to your computer and use it in GitHub Desktop.
Adding an array of integers in JavaScript using for..of
function Add(values) {
let sum = 0
for (var value of values) {
sum += value
}
return sum
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment