var myObject = { 'a': 1, 'b': 2, 'c': 3 };
Object.keys(myObject).map(function(key, index) {
myObject[key] *= 2;
});
// { 'a': 2, 'b': 4, 'c': 6 }
// ["a_1", "b_2", "c_3"]
map.map((key, value) => key + "_" + value);
for (const [key, value] of myMap.entries()) {
console.log(key, value);
}
Shorthand: (key,value) Map
const callbackMap = new Map<string, PushEventCallback>([
["addComment", addCommentCallback],
["commentModified", editCommentCallback]
]);
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#:~:text=Cloning%20and%20merging%20Maps
m.set('color', 'red')
m.set('age', 2)