I need to set one of the array property using arrow function. In my sample code I have added random key and an arrow function. but when I console the output, I cant see the "random" key. Can this be done using arrow functions.
let Allitems = {"items":[{"id":74489},{"id":64489},{"id":53489}]};
const newarr = Allitems.items.map(e => ({...e, name:"newnamme", random: (e) => { return e.id + "random"; } }));
console.log(newarr);
// expected output
{"items":[
{"id":74489,name:"newnamme", random : "74489random"},
{"id":64489,name:"newnamme", random : "64489random"},
{"id":53489,name:"newnamme", random : "53489random"}]
}