Skip to content

Instantly share code, notes, and snippets.

@isacjunior
Last active August 29, 2017 21:30
Show Gist options
  • Save isacjunior/3c0c23a189806e8157213a7a5e779d41 to your computer and use it in GitHub Desktop.
Save isacjunior/3c0c23a189806e8157213a7a5e779d41 to your computer and use it in GitHub Desktop.
const numbers = [3, 1, 6]
function sumNumbers(numbers) {
let result = 0
for(let i = 0; i < numbers.length; i++) {
result += numbers[i]
}
return result
}
console.log(sumNumbers(numbers)) // 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment