The typical way of creating a Javascript object is the following:
var map = new Object(); map[myKey1] = myObj1; map[myKey2] = myObj2;
I need to
In ES2015 a.k.a ES6 version of JavaScript, a new datatype called Map is introduced.
Map
let map = new Map([["key1", "value1"], ["key2", "value2"]]); map.get("key1"); // => value1
check this reference for more info.