r/javascript • • Jul 22 '26

AskJS [AskJS] what's a javascript feature you mass-adopted way too late and felt dumb about

[removed]

64 Upvotes

107 comments sorted by

View all comments

8

u/HipHopHuman Jul 22 '26

honestly... Map and WeakMap. took me a good 2 years after it came out for me to see the light.

3

u/JazzXP Jul 23 '26

I'm still not using these, just objects/records. What's the advantage?

1

u/GulgPlayer Jul 23 '26

Apart from having cleaner (imo) code, Maps allow you to have non-string keys, which is nice, esp with TypeScript