자바 스크립트 계산 나이 주어진 날짜 문자열
function getAge(dateString) {
var ageInMilliseconds = new Date() - new Date(dateString);
return Math.floor(ageInMilliseconds/1000/60/60/24/365); // convert to years
}
console.log(getAge('1997-04-23'));
자바 스크립트 나이 계산
calculate Age using Javascript