key value in map javascript code example
Example 1: map in javascript
['elem', 'another', 'name'].map((value, index, originalArray) => {
console.log(.....)
});
Example 2: javascript map ket to value
m.set('color', 'red')
m.set('age', 2)
Example 3: key value in map javascript
const map = {"a": 1, "b": 2, "c": 3};
const mapped = Object.entries(map).map(([k,v]) => `${k}_${v}`);
console.log(mapped);