Created
September 10, 2012 11:33
-
-
Save chooh/3690437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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