Created
September 14, 2012 07:05
-
-
Save jeroenbourgois/3720384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bad | |
var obj = {'prop':'value', 'prop':'value', 'prop':'value'}; | |
var obj = {'prop':'value', | |
'prop':'value', | |
'prop':'value'}; | |
var obj = { | |
'prop':'value', | |
'prop':'value', | |
'prop':'value' | |
}; | |
// good | |
var obj = { | |
'prop': 'value', | |
'prop': 'value', | |
'prop': 'value' | |
}; | |
// good - deeper indentation | |
function Foo() { | |
... | |
if(bar === 'cool') { | |
var baz = { | |
'prop': 'value', | |
'prop': 'value' | |
} | |
} | |
} | |
// good - variable long property names may be aligned on the ':' | |
var obj = { | |
'prop_a_bit_longer' : 'value', | |
'prop_very_very_very_long' : 'value', | |
'prop_short' : 'value' | |
}; | |
// good - but it's not mandatory | |
var obj = { | |
'prop_a_bit_longer': 'value', | |
'prop_very_very_very_long': 'value', | |
'prop_short': 'value' | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment