Getting error:
'localStorage' was used before it was defined.
What do I need to do to fix this?
localStorage is available on all modern browsers and as far as I know does not need to be defined.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Any global that you want to appear as defined to jslint can be defined in a comment of globals. E.g.:
This would make localStorage, console, and $ (jQuery) not trigger that warning.