I have this code:
var Class = function(){ // function constructor
this.className = 'Class';
}
Class.prototype.method = function(){ // open method
alert('method of ' + this.className);
}
var ClassSub = function(){ // function constructor of sub class
this.className = 'ClassSub';
}
ClassSub.prototype = new Class();
var objSub = new ClassSub();
objSub.method();
And I have one qustion: Class.prototype.method = function(){ // open method
when we write like that we say that that prototype of our class will have this method. So his subclasses will have this method to. But what i can't understand is why we can't just write
Class.method = function()