Menu
Hi, what’s the diff between the follow way of setting up a method for an object?
[code]
function Class1 (){
this.method = class1Method;
}
function class1Method(param1, param2){
//code do something…
}
second approach….
[code]
function Class2(){
}//end class2
function class2Method(param1, param2){
//code do something …
}
Class2.prototype.method = class2Method;
thank you ?