Skip to content

Instantly share code, notes, and snippets.

@sergi
Created February 3, 2012 11:03
Show Gist options
  • Save sergi/1729678 to your computer and use it in GitHub Desktop.
Save sergi/1729678 to your computer and use it in GitHub Desktop.
function HugeAnimal(name) {
Animal.apply(this, arguments)
}
HugeAnimal.prototype = new Animal
HugeAnimal.prototype.constructor = HugeAnimal
HugeAnimal.prototype.toString = function() {
return 'im ' + this.name + ' a ******* huge animal'
}
print(new HugeAnimal('Simon'))
// => 'Im Simon, a ******* huge animal'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment