1var arr = [{
2 id: 1,
3 name: 'bill'
4}, {
5 id: 2,
6 name: 'ted'
7}]
8
9var result = arr.map(person => ({ value: person.id, text: person.name }));
10console.log(result)
1var result = arr.map(person => ({ value: person.id, text: person.name }));
2console.log(result)