javascript: how to MAP through a list of itiems code example
Example 1: typescript map list to new list of objects
var result = arr.map(person => ({ value: person.id, text: person.name }));
console.log(result)
Example 2: javascript map
The map() method creates a new array with the results of calling a provided function on every element in the calling array.