I am dealing with an array of dates that looks like this:
var dateArray = ["1965-12-29", "1902-11-04", "1933-10-21", "1983-10-16"];
My goal is to check and calculate each date of birth element to determine if the age is less than 110 years old based solely on the year. If the age is greater than 110 years (based only on the year), then I want to remove/delete that element from the dateArray.
In essence, I am trying to replicate the following SQL query in JavaScript:
FROM TABLE X
WHERE TO_CHAR(DOB, 'YYYY') > (TO_CHAR(TO_DATE('2014/09/30', 'YYYY/MM/DD'), 'YYYY') - 110)
Thank you very much.