Skip to content

Instantly share code, notes, and snippets.

@daGrevis
Created February 3, 2020 09:29
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 daGrevis/d2d5a92c0f3e541e2581c1c5915fd21e to your computer and use it in GitHub Desktop.
Save daGrevis/d2d5a92c0f3e541e2581c1c5915fd21e to your computer and use it in GitHub Desktop.
const x = [1, 2, 3]
x.reduce((n, acc) => {
if (n > 2) {
return acc
}
return acc + n
}, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment