JSLint will catch those pesky trailing commas,

Javascript is a sloppy language and often needs to be portable amongst sloppy browsers with sloppy parsers. A static code analysis tool exists called JSLint which has a much stricter parser. It tells you what lines break its tenets, and allows you to switch some tenets on and off, thus making your code less prone to stupid programmer mistakes. If pasting your code into a browser window seems obnoxious, skim the docs to find out how to run it locally; I’ve added a hotkey to my Ultraedit config which runs JSLint on my current file (via Microsoft Windows Script Host.)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: