Be warned - the month value that the Date object uses is between 0 and 11
Having said that, given that the year month and day are numbers in a manner that we are used to using, a script can remove one from the month and work out the persons age in the following manner.
Find out if the person has had they birthday yet. If they have, they will be todays year minus their birth year old.
You can find out if they have had their birthday by comparing this year with their birth month and day, to the
If they are yet to have their birthday, they will be a year younger than that.
var isBeforeBirthday = new Date(new Date().getYear(), month - 1, day) < new Date(),
age = new Date().getFullYear() - (isBeforeBirthday ? 1 : 0) - year;
And if we want to get picky, we can ensure that even if todays day is their birthday, that we compare midnight of today to their birthdate.
var midnightToday = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0),
isBeforeBirthday = new Date(new Date().getYear(), month - 1, day) < midnightToday,
age = midnightToday.getFullYear() - (isBeforeBirthday ? 1 : 0) - year;