JSFiddle - React, Tailwind, and code Playground
JavaScript
if (yearDiff < 1) {
if (monthDiff < 7) {
console.log("6 months or older");
} else {
console.log("Too young");
}
} else {
if (monthDiff > 5) {
console.log("6 months or older");
} else {
console.log("Too young");
}
}