Some time ago, I came across Addy Osmani’s article on JavaScript Style Guides and Beautifiers. Mr. Osmani, in case you’re not familiar with him, is a JavaScript expert and a wonderful writer.
In the article Osmani starts by explaining what style guides are, why they’re important, and what the most common options are. Then the article explains how one might applies style rules to some sample code. The article concludes with a discussion of beautifiers.
All in all, well worth reading if you do any JavaScript programming.