Skip to content
Advertisement

How do I make this JavaScript compatible with “use strict”?

JavaScript

I know the issue is that “minYear” and “maxYear” are undeclared variables, but I’m not sure how I’m meant to declare them without breaking the code entirely?

Advertisement

Answer

minYear and maxYear are variables like the others (date, dd, mm, etc…).

You should declare them using the “var ” prefix, the first time you are using them.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement