how to use method inside method of a constructor?
method.getTotalDays = function(){
return (this.longi-this.age)*365;
}
method.eatPercent = function(){
return this.eat/24;
}
In my next method within this constructor, I want to calculate the days
that "eating process" costs in my life. For example, I want to have a
method like this:
method.getEatingDays = function(){
var days = 0;
days = eatPercent*totalDays; //How do I get eatPercent and totalDays by
using the established
//methods?
}
No comments:
Post a Comment