有2个javascript日期,首先是生日第二个是从该日期开始计算年龄的日期。执行此操作的最佳方法应该是什么。 最佳答案 functioncalculateAge(birthDate,otherDate){birthDate=newDate(birthDate);otherDate=newDate(otherDate);varyears=(otherDate.getFullYear()-birthDate.getFullYear());if(otherDate.getMonth()例子:varage=calculateAge("02