A Javascript syntax checker, written itself in JavaScript. It helps a lot, in particular in bug fixing. I usually have www.jslint.com open in a browser window while developing JavaScript code in a text editor.
You can enter any JavaScript code from the clipboard and get the following:
- A list of problems with the code. Most of these problems are real problems. For example: Not anybody knows that it is extremely dangerous to use the parseInt() function with only one argument: If you write
Did you know that after processing this statement, the variable i will have the value 13, not 15?
var i = parseInt( '0000015'); // Usually not good!
Other checks are of purely pedagogical nature. For example "eval is evil" reminds you that eval() is a highly expensive function. - A symbol table with all global variables. Look for suspicious names like "i" or "myLocalVariable"! Did you forget the "var" statement?
- A cross reference table for the usage of all symbols (globals, parameters and locals) in each function. You may print it out and analyze it in detail.
A very helpful tool!
If you are interested in JavaScript, you may also have a look at the other pages by Douglas Crockford on http://javascript.crockford.com/
Rüdiger