Skip to content

Instantly share code, notes, and snippets.

@chanonroy
Last active July 26, 2021 11:01
Show Gist options
  • Select an option

  • Save chanonroy/5f94522adab9cb6d3ee7a51ecb781917 to your computer and use it in GitHub Desktop.

Select an option

Save chanonroy/5f94522adab9cb6d3ee7a51ecb781917 to your computer and use it in GitHub Desktop.
const data = [1, 2, 3]
const result = data.reduce((acc, cur) => {
return acc + cur
}, 0)
// result: 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment