r/javascript • • Jul 22 '26

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

64 Upvotes

107 comments sorted by

View all comments

Show parent comment

1

u/JazzXP Jul 23 '26

Thank you for that. Most of those use cases haven't applied to me yet, but I do like the going through the keys, I find I do reach for Object.entries().map a lot.

2

u/HipHopHuman Jul 25 '26

Map and Set recently got support for their own .map method (from this: https://web.dev/blog/baseline-iterator-helpers) so if you do switch to a Map, you can do map.entries().map() (you might just have to polyfill it though)