Skip to content

Instantly share code, notes, and snippets.

@gotascii
Created April 28, 2011 12:39
Show Gist options
  • Select an option

  • Save gotascii/946262 to your computer and use it in GitHub Desktop.

Select an option

Save gotascii/946262 to your computer and use it in GitHub Desktop.
javascript quiz question
function House() {
this.vandalize = function() {
this.vandalized = true;
}
}
function Punk() {
this.onParty = function(handler) {
this.handler = handler;
}
this.party = function() {
this.handler();
}
}
house = new House();
punk = new Punk();
punk.onParty(house.vandalize);
punk.party();
console.log(punk.vandalized);
console.log(house.vandalized);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment