May 2008
Intermediate to advanced
172 pages
4h 54m
English
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 vars.
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.
Read now
Unlock full access