Strings are not copied in JavaScript
What is really stored inside variables in JavaScript?
Objects
Everyone knows that when an object is assigned to a variable, the object value is saved somewhere in memory and the target variable is assigned the reference to the object location in memory. If the reference is assigned to another variable and then any of the two variables…