Skip to content

Instantly share code, notes, and snippets.

@chooh
Created September 10, 2012 11:33
Show Gist options
  • Save chooh/3690437 to your computer and use it in GitHub Desktop.
Save chooh/3690437 to your computer and use it in GitHub Desktop.
function A(x) { this.x = x; };
function B(x,y) { A.call(this, x); this.y = y; };
B.prototype = new A();
B.prototype.what = function(){ return "hello"; };
var d = new B(5, 10);
A.prototype.say = function(){return "say " + this.what();};
B.prototype.say = function(){return ">> : " + A.prototype.say.call(this);};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment