using map with object javascript code example
Example 1: object to map javascript
const map = new Map(Object.entries({foo: 'bar'}));
map.get('foo'); // 'bar'
Example 2: javascript map to object
Object.fromEntries(Map)
Example 3: map in javascript
['elem', 'another', 'name'].map((value, index, originalArray) => {
console.log(.....)
});