I’m using jslint.com to validate some functions and came across the error:
“A leading decimal point can be confused with a dot”
The line which triggered the error is as follows:
if ( myvar = .95 ){
How do I correct it?
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.
Easy, put a zero before the dot. I guess JSLint complains because the dot is also used for object properties so it can be confused. Plus you’re missing an equals, but in JS is recommended to use triple equals:
Now JSLint won’t complain anymore.