When I run JSlint on this piece of code I get this error
Error: Problem at line 25 character 26: ‘selectedDate’ is already
defined. var selectedDate = new Date(selectedDate);Implied global: $ 1,4,13,14,26,27,28,31,33,34,42, updateSelects
13,19,21
I think it is referring to this code
'dateSelected', function(e, selectedDate, $td, state) {
updateSelects(selectedDate);
How can I fix this?
Thanks
The error sort of explains itself.
You are declaring the variable selectedDate again, and you are filling it with a new Date object taking in the value of the original variable selectedDate. You should rename the variable to something else.
And just to note the error is occuring here: