DEV Community

Discussion on: Your Essential Guide To Map Built-in Object In Javascript

Collapse
 
toastking profile image
Matt Del Signore

Another good reason to use Map (as long as you're not serializing anything) is you don't need to worry about someone extending the prototype to add keys. With Objects you could theoretically get a key clash if someone extends the object.

Collapse
 
ayabouchiha profile image
Aya Bouchiha

Thank you for sharing with us this information 😊