var Ob = function(){
}
Ob.prototype.add = function(){
inc()
}
Ob.prototype.inc = function(){
alert(\' Inc called \');
}
window.onload = function(){
va
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
.