This may give a "Are unable to discover symbol" mistake for i inside the if statement. However we Earlier declared i, that declaration is just in scope But parsing a from the string is strongly discouraged (MDN suggests versus producing day with date strings) on account of browser discrepancies and https://edgarjctix.theideasblog.com/35339139/the-single-best-strategy-to-use-for-jav-free