Skip to content

Instantly share code, notes, and snippets.

@danesparza
Created July 15, 2011 19:39
Show Gist options
  • Save danesparza/1085394 to your computer and use it in GitHub Desktop.
Save danesparza/1085394 to your computer and use it in GitHub Desktop.
Fun with Javascript ... pointers?
// First object, with a simple string property
args1 = {};
args1.test1 = "blah";
// Second object, 'created' from the first
args2 = args1;
// As you might expect...
// args2.test1 is "blah"
// Set the property to something different
// on the second object
args2.test1 = "boo!";
// But wait -- the objects are linked!
// args1.test1 is now "boo!" too!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment