DEV Community


Discussion on: When You Should Use JavaScript Maps over Objects

iwi4a_24 profile image

Excellent article! A little correction I would do is that when defining and adding values, new Map expects an array of arrays, so new Map(["key", "value"]); will throw an Uncaught TypeError, it should be new Map([["key", "value"]]);. Again, thank you for explaining it so well!