The Map is the new object type that allows storing collections of key-value pairs. The map is similar to the Object but the main difference is that Map allows keys of any type, even objects or functions. It is easy to get the size of a Map, while it needs more effort to get the size of objects.

Take a look at a simple example on the Map with available methods and properties i.e. set, get, has, delete, clear and size.

#javascript

Introduction of ES6 Map in JavaScript
1.15 GEEK