Created
August 24, 2022 18:07
-
-
Save thawkin3/6da4b4f44e65f47a27773f070975c97d to your computer and use it in GitHub Desktop.
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
export const sumNumbersArray = (numbers) => { | |
if (numbers.length === 0) { | |
return 0; | |
} | |
return numbers[0] + sumNumbersArray(numbers.slice(1)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment