Skip to content

Instantly share code, notes, and snippets.

@graingert
Created February 20, 2014 10:14
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 graingert/9110523 to your computer and use it in GitHub Desktop.
Save graingert/9110523 to your computer and use it in GitHub Desktop.
function FooObj(){
this.location = "http://www.google.com"
this.setLocation= function (location){
this.location = location;
}
}
var foo = new FooObj();
foo.setLocation("http://www.google.com/");
console.log(foo.location)
//what happens here?
var foos_setLocation = foo.setLocation
foos_setLocation("http://www.google.com/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment