Skip to content

Instantly share code, notes, and snippets.

@graingert
Created Feb 20, 2014
Embed
What would you like to do?
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