Skip to content

Instantly share code, notes, and snippets.

@joeellis
Created April 18, 2012 17:05
Show Gist options
  • Save joeellis/2415067 to your computer and use it in GitHub Desktop.
Save joeellis/2415067 to your computer and use it in GitHub Desktop.
> f = function () { x = []; console.log(x); x.push("foo") }
function () { x = []; console.log(x); x.push("foo") }
> f()
["foo"]
> f = function () { x = []; console.log(_.clone(x)); x.push("foo") }
function () { x = []; console.log(_.clone(x)); x.push("foo") }
> f()
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment