I have the following:
const data = [
{ name: "Santa"
age: 34
},
{ name: "John"
age: 23
}
]
I should edit object elements through map().
For example: I want all age to be 68 and 46 relatively. (×2).
I tried to solve but I couldn't
data = data.map(e => {
e.age *= 2;
});
ageproperties only. So, more conventional use ofmap()would be something immutable, like that one.map()withforEach()and get your problem solved with more appropriate tool