Skip to content

Instantly share code, notes, and snippets.

@thawkin3
Created August 24, 2022 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thawkin3/6da4b4f44e65f47a27773f070975c97d to your computer and use it in GitHub Desktop.
Save thawkin3/6da4b4f44e65f47a27773f070975c97d to your computer and use it in GitHub Desktop.
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