Skip to content

Instantly share code, notes, and snippets.

@lxe
Created April 24, 2014 21:30
Show Gist options
  • Select an option

  • Save lxe/11270209 to your computer and use it in GitHub Desktop.

Select an option

Save lxe/11270209 to your computer and use it in GitHub Desktop.
# var var var vs , , ,
- , , ,
- Leading Commas
# declare on top of scope or near usage
- Consistency is not compromised -- doesn't matter
# Whenever makes sense name anonymous functions
- _.map([], function () {
})
# Conditionals
- Always braces
- Always newline
- No newline before else*
if (foo) {
// foo is engaged();
foo();
} else {
// this is what's happening when foo is not engaged
// in this whole block another line
// foo is disengaged();
notFoo();
}
A
{
foo : bar,
zanzibar : lol
}
B
{
foo: bar,
zanzibar: lol
}
C
{
foo : bar,
zanzibar : lol
}
D
{
foo: bar,
zanzibar: lol
}
This one:
E Not giving a crap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment