I am trying to check if the firstday
is equal to five or 6, in both cases if totalDays
is equal to 31 then do something, for that purpose which statement is correct?
Code 1:
if (firstday > 5 || firstday > 6 && totalDays == 31){}
Code 2:
if (firstday > 5 && totalDays == 31 || firstday > 6 && totalDays == 31) { }