正在加载视频...
视频加载失败
JavaScript Maps are super underrated. Keys of a map can be anything - including an object! Here I'm using the new groupBy proposed API to group array items into a Map or an Object →
240,399 次观看 • 3 年前 •via X (Twitter)
11 条评论

Nick Taylor3 年前
WeakMaps ftw as well!

Wes Bos3 年前
Nothing better than something that cleans up

Paulo Reis3 年前
I've been using the JavaScript Maps a lot, thanks for the teachings 💯

Wes Bos3 年前
big fan!

zayenz 🐀3 年前
Maps are great, but I really miss structural equality for the keys when they are objects, as that is so much more useful. Especially if the key is computed at lookup.

Wes Bos3 年前
I agree, I wonder if we will ever get that in JS

Web-Dev-Codi3 年前
YT comment: You should use a for loop for performance. Wes: I'm iterating over 3 things brotha. 🤣 This was hilarious

vovô ermitão3 年前
except that it lacks a hashing function hook

Wes Bos3 年前
@crudspecialist What would we use that for? Not snark, curious!

Rocky3 年前
@wesbos where can we find this video or podcasts ? Really interested in it

Wes Bos3 年前
This is it - I made it for twitter
