Calling one prototype method inside another in javascript
Solution 1:
It's easy:
Ob.prototype.add = function(){
this.inc()
}
Ob.prototype.inc = function(){
alert(' Inc called ');
}
When you create the instance of Ob
properties from prototype are copied to the object. If you want to access the methods of instance from within its another method you could use this
.