Here is my object literal:
var obj = {key1: value1, key2: value2};
How can I add field key3 with value3 to the ob
key3
value3
We can do this in this way too.
var myMap = new Map(); myMap.set(0, 'my value1'); myMap.set(1, 'my value2'); for (var [key, value] of myMap) { console.log(key + ' = ' + value); }