array map get keyof current map code example
Example 1: array map
let A = [{ x:'x', y:'y' }, { x:'x', y:'y' }];
let result = A.map(({y,...rest})=> ({...rest,v:y}));
console.log(result);
Example 2: js map function
const exampleArray = ['aa','bbc','ccdd'];
console.log(exampleArray.map(a => a.length));
//Would print out [2,3,4]