Hacker News new | ask | show | jobs
by codehero 4627 days ago
This is why you prepend the comma before every succeeding item in a list or map.
3 comments

This is what I do, but it basically just has the effect of making the first item special instead of the last. That's usually better in practice, though.
You've slightly improved the problem by moving it away from the last item on the list, but you've now screwed up the first item. You can no longer insert a first-item using the same format, and instead of a trailing comma bug you can get a starting comma bug.
This seems to only move the problem to the first item instead of the last one, not solve it.