Created
January 3, 2023 13:37
-
-
Save deleteman/3fd7ecc7e22435a36952b3cca8bccf01 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 addNumbers(numbers) { | |
let sum = 0; | |
for (let i = 0; i < numbers.length; i++) { | |
sum += numbers[i]; | |
} | |
return sum; | |
} | |
let numbers = [1, 2, 3, 4, 5]; | |
console.log(addNumbers(numbers)); // Output: 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment