how to use array.map code example
Example 1: map a property from array of objects javascript
var result = objArray.map(function(a) {return a.foo;});
Example 2: array map
let A = [{ x:'x', y:'y' }, { x:'x', y:'y' }];
let result = A.map(({y,...rest})=> ({...rest,v:y}));
console.log(result);