Advertisement
pharmokan

hashmap js

Jun 6th, 2020
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. const hashmap = arr.reduce((hashmap,e) => {
  2. hashmap[e] ? hashmap[e]++ : (hashmap[e] = 1)
  3. return hashmap
  4. }, {})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement