function name() { }
for named functionsfunction(){ }
for anonymous functions- No curly braces for single-line control flow statements such as
if
& friends - Don't write semicolons that are optional
- Put a single semicolon before statements that start with
(
or[
(see above article as for why it's needed) - Use long, descriptive variable and method names
- Use blank lines to separate "paragraphs" of code for readability
- Use comments to describe non-obvious code behavior