3 ms·
But there's always a line without a comma -- comma-last has it on the last line instead of the first. So you can have the same line-swapping problem in either a
by cwyers 9y ago
But there's always a line without a comma -- comma-last has it on the last line instead of the first. So you can have the same line-swapping problem in either arrangement. Comma first just makes it easier to spot.
- icebraining 9y agoBut there's always a line without a comma -- comma-last has it on the last line instead of the first. Not if the language allows trailing commas on the last line, like Python and Go do.
- coldtea 9y agoNot if you allow dangling commas (trailing commas as the sibling comment calls them, I think it's the more generic term)... Then you have a comma at the end in ALL lines, including the last one, without an issue. That was what I proposed above (and lots of languages do it, I think JS is adding it too).