You must log in or register to comment.
- Ephera ( @Ephera@lemmy.ml ) 5•2 years ago
Yeah, I fall for that so often. Can’t move or delete lines without double-checking that you didn’t accidentally leave a comma at the end…
- Bilb! ( @bilb@lemmy.ml ) 4•2 years ago
And javascript is otherwise so lax! You like semicolons? Put as many of them as you want wherever you like! Or don’t.
- splatt9990 ( @splatt9990@lemmy.ml ) 5•2 years ago
JSON is a serialization format based on js syntax. It’s not the same as JavaScript, it’s usually stricter. Those stricter rules are designed to make it easier to parse. In actual js, trailing commas are just fine (although i think some versions of internet explorer parsed them as nulls for some reason.)
- ☆ Yσɠƚԋσʂ ☆ ( @yogthos@lemmy.ml ) 4•2 years ago
The best approach I’ve seen is to just treat commas as whitespace the way EDN does.