Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

14
  • 56
    for the curious-in the latest chrome, any map serializes into '{}'
    – Capaj
    Commented Jan 6, 2016 at 16:20
  • 14
    "It might be faster" - Do you have any source on that? I'm imagining a simple hash-map must be faster than a full blown object, but I have no proof. :)
    – Lilleman
    Commented Feb 11, 2016 at 18:01
  • 3
    @Xplouder That test uses expensive hasOwnProperty. Without that, Firefox iterates objects much faster than maps. Maps are still faster on Chrome, though. jsperf.com/es6-map-vs-object-properties/95
    – Oriol
    Commented Mar 18, 2016 at 13:49
  • 6
    Just passing by and figure out my problem thanks to this. I really wish to move to a farm and leave all this behind, sometimes.
    – napolux
    Commented Aug 10, 2020 at 14:38
  • 3
    While this answer definitely points out the tricky bits, it most certainly is not "impossible" as the accepted answer demonstrates.
    – Stefnotch
    Commented Jul 28, 2022 at 15:52