map to new object js code example
Example 1: object to map javascript
const map = new Map(Object.entries({foo: 'bar'}));
map.get('foo'); // 'bar'
Example 2: typescript map list to new list of objects
var result = arr.map(person => ({ value: person.id, text: person.name }));
console.log(result)
Example 3: javascript map to object
Object.fromEntries(Map)
Example 4: javascript map ket to value
m.set('color', 'red')
m.set('age', 2)