this.users = this.users.map(oldUser => oldUser.id === user.id ? user : oldUser);
above code is to splice in updated user's data into users object, but in the same time I also wanted to add extra property into user object, I tried
this.users = this.users.map(oldUser => {
if(oldUser.id === user.id){
user.updated = 'grade';
return user
}else{
return oldUser
}
});
but seeing array of object within array of object, I guess my map messed up