Guest User

Untitled

a guest
May 20th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. const obj = { books: 10, ruler: 1, pencils: 5 }
  2. const total = Object.values(obj).reduce((acc, value) => acc + value, 0) // without conductor
  3. const total = reduce((acc, value) => acc + value, 0, obj) // with conductor
Add Comment
Please, Sign In to add comment