Skip to content

Instantly share code, notes, and snippets.

@pbrandiezs
Created April 1, 2022 15:55
Show Gist options
  • Save pbrandiezs/e86b73e78af9e4dd517a7b87475dc6af to your computer and use it in GitHub Desktop.
Save pbrandiezs/e86b73e78af9e4dd517a7b87475dc6af to your computer and use it in GitHub Desktop.
Simple array sum
function simpleArraySum(ar) {
let sum = 0;
for (let i=0; i < (ar.length); i++) {
sum = sum + ar[i];
}
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment