Skip to content

Instantly share code, notes, and snippets.

@flavioribeirojr
Created March 21, 2020 13:36
Show Gist options
  • Save flavioribeirojr/15af286fd8c1771ff440cfa84e998fdf to your computer and use it in GitHub Desktop.
Save flavioribeirojr/15af286fd8c1771ff440cfa84e998fdf to your computer and use it in GitHub Desktop.
Reducer basic example
const numbers = [5, 10, 15];
const sum = numbers.reduce((sum, number) => sum + number, 0)
// sum = 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment