change value of key in array of objects javascript
const users = [
{ name: "Alex", age: 25 },
{ name: "John", age: 32 },
];
const newUsers = users.map((user) => ({
...user,
age: user.age + 5, // just for example
}));
// newUsers = [
// {name:"Alex" , age:30},
// {name:"John , age:37}
// ]