javascript map to new object 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)