In front-end JavaScript coding, there's a nice tool called JSLint that can check the normalization of the code and see what JSLint's error prompts mean:
You are missing a semicolon. You are missing a period.
Unnecessary space after - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mixed spaces and tabs. Mixed spaces and tabs.
Unsafe characters. Unsafe: Unsafe characters.
This is the first time I've seen this kind of thing in my life.
This is the URL of the script.
You're not supposed to be here. You're not supposed to be here. You're not supposed to be here.
In addition to the above, there are also a number of other things that you can do in order to get rid of the problem.
You can't get away from it. You can't get away from it.
You can avoid \v.
Avoid \x-.
Bad escapement. Bad: Bad transliteration of the character bad.
Bad number
Don't use extra leading zeros. Don't use extra leading zeros.
A trailing decimal point can be confused with a dot.
You should not have commented here, but you should have commented here.
You're not going to be able to get away with it.
Unexpected control character in regular expression.
I'm not sure if I'm safe or not, but I'm not sure I'm safe.
It's like an empty classroom.
You have a really bad name, you have a really bad name, you have a really bad name.
A dot following a number can be confused with a decimal point.
Confusing minusses: the confusing negative expressions of -i, -i, -i, -i, -i, -i, -i.
Confusing plusses.confusing: The confusing positive expression +confusing, which can be confused with +confusing, which can be confused with +confusing.
You can't match the size of a cat, you can't match the size of a cat.
Unforeseen early end of program.
A leading decimal point can be confused with a dot:
Unnecessary space before
You can't use the word "a" here, but you can use the word "a" here.
It's a bad operand. It's a bad operand.
Use the isNaN function to compare with NaN.
Confusing use of
It's called "Read only".
I'm not sure if this is a good idea, but I'm not sure if it's a good idea, but it's a good idea.
Missing name in function declaration.
Inner functions should be listed at the top of the outer function.
I'm not sure if you're familiar with this, but I'm not sure if you're familiar with it.
It looks like a javascript url. It looks like a js link bar.
Expected an assignment or function call and instead saw an expression.
It's not necessary. It's not necessary. It's not necessary.
It's like the empty block. It's like the empty block.
It's not supposed to be there. It's not supposed to be there.
Variables should not be deleted.
“The Function constructor is eval.”:“The Function constructor is eval.”,
A constructor name should start with an uppercase letter.
Bad constructor.Bad: Bad constructor is a bad constructor, bad constructor is a bad constructor.
Missing
I'm not sure if I'll be able to do it, but I'm not sure if I'll be able to.
It's called "Missing radix parameter".
Implicated eval is evil. Pass a function instead of a string.
Bad invocation.Bad invocation: Bad invocation is the wrong invocation.
It's not just that I'm not a fan of the idea of using a comma, I'm also a fan of the idea of using a comma.
Don't make functions within a loop.
It's a duplicate member. It's a duplicate member. It's a duplicate member.
I was expecting to see a statement and instead saw a block.
I'm not sure if this is a good idea, but I'm not sure if it's a good idea.
Expected an assignment or function call and instead saw an expression.
Use a function expression or move the statement to the top of the outer function.
1 [W099]:Mixed spaces and tabs
This error is the most common, meaning that in the same line, spaces and tab shrinkage are used in combination. The modification is simple, generally removing tab shrinkage and changing it all to spaces. For convenience, we can set the editor's tab shrinkage to 2 or 4 spaces, to replace the original shrinkage.
2 [W030]:Expected an assignment or function call and instead saw an expression
This error is weird, and I'm using this error code index-1 <0? index = 0:index = index - 1; it's a comma expression, but JSLInt thinks it shouldn't be an expression, it has to be a function, so, if you really care about this error, just change it to the if else statement.
3 [W041]:Use ‘===’ to compare with …
This error is that if we replace the whole array with equal, if the data types on both sides of the expression are the same, we recommend using the whole array to judge.
4 [W033]:Missing semicolon
Missing the decimal point; this is usually something I forget to write, but one thing to note is that for only one sentence structure, a decimal point is also required. For example: if ((index<0) {index=tcount-1} This code, the correct spelling is if ((index<0) {index=tcount-1;}, I often forget to write the decimal point here, Khan...
There are also a few other misguided tips, so check them out and develop your own good coding style and writing habits.
Translated fromhttp://www.zystudios.cn/blog/post/70.ShtmlThe blog of the little girl