Mental Model
Count how many times each item appears by using a map to store counts.
Analogy: Like counting how many apples, oranges, and bananas you have by putting each fruit in separate jars and adding one each time you see that fruit.
items: [a, b, a, c, b]
map: {}
After counting:
map: {a:2, b:2, c:1}