js add to map code example
Example 1: append to map javascript
var myMap = {};
myMap[newKey] = newValue;
// ...
// Another method
var myMap = new Map()
myMap.set("key0","value")
// ...
myMap.has("key1"); // evaluates to false, assuming key1 wasn't set
Example 2: javascript map
const numbers = [0,1,2,3];
console.log(numbers.map((number) => {
return number;
}));