So I've been reading up on proposed JavaScript features, and one I'm concerned about is trailing comma support in object literals and arrays.
For parameters, trailing commas don't relate here, so let's ignore that. I understand the Version Control benefits, but I'm worried how it will react to JSON.
const arr = [
'red',
'green',
'blue',
];
This would become valid.
But what will happened when you return JSON syntax? JSON is supported by RFC, so I doubt JSON will ever support trailing commas. Maybe one day..
But how will JavaScript handle returning something like:
const jsonReturn = [{
"derp":1
}, {
"foo":"bar"
}, {
"slide":true,
},];
Will the trailing comma be removed internally if the header content type is JSON or will trailing commas break everything?