Google JavaScript Style Guide
A JavaScript style guide to go along with Google’s HTML & CSS style guide
JavaScript is the main client-side scripting language used by many of Google’s open-source projects. This style guide is a list of dos and don’ts for JavaScript programs.
Here are some really good one’s
- Always use semicolons
- Declarations with var: Always
- Use a variable initialized with a Function Expression to define a function within a block
- Associative Arrays are not allowed
- Because of implicit semicolon insertion, always start your curly braces on the same line as whatever they’re opening.
- For consistency single-quotes (‘) are preferred to double-quotes (“)
