Skip to content

Instantly share code, notes, and snippets.

@paladinescamila
Created December 20, 2021 18:32
Show Gist options
  • Save paladinescamila/269aa2e824e8e31d415fc57eed0b547b to your computer and use it in GitHub Desktop.
Save paladinescamila/269aa2e824e8e31d415fc57eed0b547b to your computer and use it in GitHub Desktop.
let numbers = [1,2,3,4,5];
let reducer = (previus, current) => previus + current;
// sum = 15
let sum = numbers.reduce(reducer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment