Hacker News new | ask | show | jobs
by yowzadave 1316 days ago
That's correct, but you can use a trailing comma if you prefer uniform lists:

  [
    a,
    b,
    c,
  ]
1 comments

I simply prefer :

[ a

, b

, c

]

because, I think this is as 'uniform" as it gets. All syntactic separators are in the first column. Thus they are all uniformly in the same column. Line 1 has the syntactic separator '[' which means start-of-array. Lines 2 and 3 have ',' as the syntactic separator which means element-separator. And line 4 has the final syntactic marker which means "end of Array".

All elements of the array start at the same column, uniformly. And all syntactic separators are in the same column also uniformly.