method.getTotalDays = function(){
return (this.longi-this.age)*365;
}
method.eatPercent = function(){
return this.eat/24;
}
在此构造函数中的下一个方法中,我想计算“进食过程”在我的生活中花费的天数。例如,我想要一个这样的方法:
method.getEatingDays = function(){
var days = 0;
days = eatPercent*totalDays; //How do I get eatPercent and totalDays by using the established
//methods?
}