Skip to content

Instantly share code, notes, and snippets.

@tamzinblake
Created June 13, 2011 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamzinblake/1023305 to your computer and use it in GitHub Desktop.
Save tamzinblake/1023305 to your computer and use it in GitHub Desktop.
alternate comma-first style
//an alternate comma-first style soon to be supported by my js-mode
//The assumption is that you will consistently not put the first item in the
//list on the same line as the brace, and then want the commas / operators
//2 spaces back from there.
//normal cases:
var test = {
prop1: "value1"
, prop2: "value2"
, prop3: "value3"
}
var y = [
"value1"
, "value2"
]
function test2 () {
var x
x.report(
"test1"
+ "test2"
)
}
//big nested thingy
var test = {
test1: {
test2: {
test3: 'this is ok'
}
, test4: {
test5: 'this is weird'
, test6: 'this is weird also'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment