I'm wondering if the following can be done another way in javascript/es6:
var myMap = new Map();
myMap.set("id1", {"name": "John", "address":"near"} );
myMap.set("id2", {"name": "Úna", "address":"far away"} );
myMap.set("id2", {"name": "Úna", "address":"near"} );
I'm new to javascript and have read in Map's documentation that Objects have historically been used as Maps. Can the above been done using objects? I really don't like that I have to use set
and get
either.