Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const obj = { books: 10, ruler: 1, pencils: 5 }
- const total = Object.values(obj).reduce((acc, value) => acc + value, 0) // without conductor
- const total = reduce((acc, value) => acc + value, 0, obj) // with conductor
Add Comment
Please, Sign In to add comment