4 ms·
Side note: it's really sad that more languages aren't allowing trailing commas in sequence literals and other places, like Python does. In Python, these are leg
by int_19h 8y ago
Side note: it's really sad that more languages aren't allowing trailing commas in sequence literals and other places, like Python does. In Python, these are legal:
[1, 2, 3,]
foo(1, 2, 3,)
And thus, when writing multiline literals and calls, it's pretty common to use the comma as a line terminator, precisely so that new lines can be added at the end without touching the previous line.
- ergothus 8y agoJavascript DOES allow trailing commas, though it never caught on since IE6 would blow up on them. JSON, however, does not.