Call function in parent class

by Mohan 2012-09-20 23:55:10

Call function in parent class
toto.prototype = new function() {

this.a = function() {

Print(456)
}
};


function toto() {

this.a=function(){

Print(123)
toto.prototype.a.call(this); // or: this.__proto__.a();
}
}

var o = new toto;
o.a();
prints:
123
456
586
like
0
dislike
0
mail
flag

You must LOGIN to add comments