The Startup
Published in

The Startup

Maps in Javascript

ES6 introduced new data structures to take care of some problems that the language did not take care of.

Before its’ introduction, people generally used Objects to do the work.

However, Objects do not allow keys to be anything other than a string or integer. Keys in a Map, on the other hand, can be anything (object, array, string, or number). This allows for some interesting uses.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store