JSLint: neat javascript script verifier tool

I found a useful little utility called Lint that checks for things in your javascript code that’s likely to introduce errors.

I really like that it checks for undeclared variables because I always, always, always want to declare my variables before I use them. Considering that forgetting to declare the variable sets it global for the whole page and that some pages use script from several different third party controls, I can imagine some really nasty scenarios that would be near impossible to debug.

The guy who wrote the tool also wrote a really interesting page on things that the tool checks for. The really interesting thing was that I didn’t know that there was only function scope and global scope for variables. I’d always assumed that declaring the scope worked the same as languages like C# and Java in that declaring a variable within a block meant it went out of scope when the block was finished.

Posted on 15 Aug 05 by Helen Emerson (last updated on 15 Aug 05).
Filed under Javascript, Tools