Skip to content

Instantly share code, notes, and snippets.

@WaldoJeffers
Last active May 26, 2018 18:19
Show Gist options
  • Save WaldoJeffers/069e93d2173f7a2462a9948056eeb15b to your computer and use it in GitHub Desktop.
Save WaldoJeffers/069e93d2173f7a2462a9948056eeb15b to your computer and use it in GitHub Desktop.
Reduce an object without conductor
const obj = { books: 10, ruler: 1, pencils: 5 }
const add = (a, b) => a + b
const total = Object.values(obj).reduce(add, 0) // 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment