Skip navigation
JavaScript Maps are super underrated.
0:00 / 2:04

JavaScript Maps are super underrated.

Wes Bos

@wesbos448K followers

Visit on X
1,902 likesDownloadOriginal post

240,422 views

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 →

11 Comments

Comments from the original post on X (Twitter)

  • Nick Taylor's profile picture

    @nickytonline

    WeakMaps ftw as well!

    5 likes

  • Wes Bos's profile picture

    @wesbos

    Nothing better than something that cleans up

    5 likes

  • Paulo Reis's profile picture

    @pauloreiss7

    I've been using the JavaScript Maps a lot, thanks for the teachings 💯

    4 likes

  • Wes Bos's profile picture

    @wesbos

    big fan!

    2 likes

  • zayenz 🐀's profile picture

    @zayenz

    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.

    4 likes

  • Wes Bos's profile picture

    @wesbos

    I agree, I wonder if we will ever get that in JS

    1 like

  • Web-Dev-Codi's profile picture

    @WebDevCodi

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

    2 likes

  • vovô ermitão's profile picture

    @willscl

    except that it lacks a hashing function hook

    2 likes

  • Wes Bos's profile picture

    @wesbos

    @crudspecialist What would we use that for? Not snark, curious!

  • Rocky's profile picture

    @GRKARTHIKGR

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

    1 like

  • Wes Bos's profile picture

    @wesbos

    This is it - I made it for twitter

    1 like