I\'m using a specific game making framework but I think the question applies to javascript
I was trying to make a narration script so the player can see \"The orc hi
There are two ways to use deep copy the object before pushing it into the array. 1. create new object by object method and then push it.
servermessagelist = [];
servermessagelist.push(Object.assign({}, servermessage));
Create an new reference of object by JSON stringigy method and push it with parse method.
servermessagelist = [];
servermessagelist.push(JSON.parse(JSON.stringify(servermessage));
This method is useful for nested objects.