예시1
let today = new Date(2025, 0, 19);
let DOB = new Date(1994, 3, 21);
function ageCalc(startDate) {
let timeDiff = today.getTime() - startDate.getTime();
let dayDiff = timeDiff / 1000 /60 / 60 / 24;
console.log(`오늘은 태어난 지 ${dayDiff +1}일째 되는 날 입니다.`);
}
ageCalc(DOB);
결과 1
