Skip to content

Instantly share code, notes, and snippets.

@reergymerej
Created April 29, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reergymerej/acd7a04a232839cf191c to your computer and use it in GitHub Desktop.
Save reergymerej/acd7a04a232839cf191c to your computer and use it in GitHub Desktop.
var a = [{ foo: 'bar' }];
var method = function (arr) {
var local = arr.slice();
console.log(local === arr);
local.forEach(function (obj) {
console.log(coll === arr);
obj.wtf = true;
});
};
method(a);
console.log(a); // How did "wtf" get here?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment