JavaScript allows var
definitions to occur
anywhere within a function. JSLint is stricter.
JSLint expects that:
A var
will be declared only once, and
that it will be declared before it is used.
A function will be declared before it is used.
Parameters will not also be declared as var
s.
JSLint does not expect:
The arguments
array to be declared as a
var
.
That a variable will be declared in a block. This is because JavaScript blocks do not have block scope. This can have unexpected consequences, so define all variables at the top of the function body.
18.217.108.11