Skip to content

Why in JavaScript doesn't Map have anything like .map, .reduce, etc.?

2 pointsmeeech3 comments
On HN

Just wondering if anyone has any insight (links?) or was involved in any of the discussions around Map() in JS. Was just wondering - it seems like the general methods - map, reduce, some, etc... - would have been useful on Maps as well, so i got curious why they weren't?

Comments

IIRC, adding those operations was merely postponed, not rejected.

These are work-arounds: https://exploringjs.com/impatient-js/ch_maps.html#missing-ma...

Thanks. I was just curious about the why. i'm good with working around it.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.