get data from map inside map javascript code example
Example 1: map through keys javascript
var myObject = { 'a': 1, 'b': 2, 'c': 3 };
Object.keys(myObject).map(function(key, index) {
myObject[key] *= 2;
});
console.log(myObject);
// => { 'a': 2, 'b': 4, 'c': 6 }
Example 2: node get value from map
let myMap = new Map();
myMap.set("key1", "value1");
myMap.set("key2", "value2");
console.log(myMap.has("key1")); // true
console.log(myMap.has("key2")); // true
console.log(myMap.get("key1")); // value1
console.log(myMap.get("key2")); // value2
// NOTE: DO NOT try to access map values using [].
// myMap["key1"] = "value1";