Well, you need to change the property myObject.newuser[0].id to myObject.user[0].id , after which it will set the new value to the existing value of the user.
Since you are changing the previously added value with the new value.
For more information about the customizer, see the MDN link .
source share