What are maps?

A map’hash map’, ‘associative array’ or ‘dictionary’ provides a mapping from keys to their associated values. Traditionally, before the built-in Map object was added to JS (in ES6), maps were implemented in the form of plain JS objects. In these plain JS objects, the keys were string literals that could include blank spaces, as shown below:

Get hands-on with 1400+ tech skills courses.