Below you will find pages that utilize the taxonomy term “reference”
Posts
Clone javascript objects
In javascript, if we copy objects or their properties, the reference still remains and by changing the new object the old one is changed, too. To clone or do a clean copy of an object I found a very useful solution by Jan Turoň on StackOverflow:
Object.prototype.clone = function() { if(this.cloneNode) return this.cloneNode(true); var copy = this instanceof Array ? \[\] : {}; for(var attr in this) { if(typeof this\[attr\] == "function" || this\[attr\]==null || !