Created
April 30, 2013 14:16
-
-
Save barakargaman/5489019 to your computer and use it in GitHub Desktop.
Revisions
-
barakargaman created this gist
Apr 30, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ function A() { this.aParam = 'a sababa', this.aFunction = function() { return this.aParam; } }; function B() { this.bParam = 'b sababa', this.bFunction = function() { return this.bParam; } }; function C() { this.cParam = 'c sababa', this.cFunction = function() { return this.cParam; } }; function D() { this.dParam = 'd sababa', this.dFunction = function() { return this.dParam; } }; B.prototype = new A(); C.prototype = new B(); D.prototype = new C(); var a = new A(); var b = new B(); var c = new C(); var d = new D(); // ---------------------- console.log(d.dParam) // d sababa console.log(d.cParam) // c sababa console.log(d.aFunction()) // a sababa