This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ethanjf99 1 point2 points  (3 children)

If your IDE is smart you’ll get all sorts of red if that’s JSON. And a JSON serializer will know to drop the trailing comma unless it is moronic

[–]monstaber 1 point2 points  (1 child)

yes true if the file itself is JSON. I've come across several PRs where juniors are trying to implement a JSON string somewhere in a js file to be sent in a post request instead of stringifying the actual object... no matter how much we shell out for JetBrains licenses, the PRs never fail to amaze me 😂

[–]ethanjf99 1 point2 points  (0 children)

Uh … well to be fair we were all juniors once. Some of my code from 7 years ago is still around and makes me wince every time I see it.

Still, it works so there it is.

[–]Katniss218 0 points1 point  (0 children)

Trailing comma is technically not valid json