Created
April 1, 2022 15:55
-
-
Save pbrandiezs/e86b73e78af9e4dd517a7b87475dc6af to your computer and use it in GitHub Desktop.
Simple array sum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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