Fun with Javascript pointers
I just spent the last hour trying to debug some Javascript code that wasn’t working the way I expected. It turns out I was dealing with the shallow copying behavior of Javascript. If you deal in Javascript objects regularly, you need to know this information! Here is a quick example that illustrates what I saw while debugging today: // First object, with a simple string property args1 = {}; args1.test1 = "blah"; // Second object, 'created' from the first args2 = args1; // As you might expect....