How to access this function in my object?
问题 I have a function object: var myObj=function(){ }; myObj.prototype = { availableColor: function(i){ return "red_"+i; } getColor: function(){ var c = availableColor('3'); //Error: availableColor is not a function ... } } When I call availableColor(i) inside getColor() function, I got error availableColor is not a function .... I also tried to use var c = this.availableColor('3'); and var self=this in the constructor, then var c = self.availableColor('3'); But, none of these help. what is the