Pure JavaScript solution:
const date = new Date(year, (+month-1), day);const isValidDate = (Boolean(+date) && date.getDate() == day);
Also works on leap years!
Credit to https://medium.com/@esganzerla/simple-date-validation-with-javascript-caea0f71883c