Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const hashmap = arr.reduce((hashmap,e) => {
- hashmap[e] ? hashmap[e]++ : (hashmap[e] = 1)
- return hashmap
- }, {})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement