So I have 3 different inputs for the user - Day/Month/Year, and I'm trying to run an if statement to check if the month is Jan/Feb (1 or 2), and then if it subtracts 1 from the year. My if statement is:
if (month == 1 || month == 2) {
if (month == 1) {
year = Number(year) - 1;
}
else if (month == 2) {
year = Number(year) - 1;
}
}
This is my first time trying to use javascript and it's very frustrating!
As you can see my code runs when I have month = 3, but as soon as I change it to 1 or 2 it no longer executes...