So, I read about the proposed JavaScript functions, and one of them concerns reverse comma support in object literals and arrays.
For parameters, trailing commas are not related here, so do not pay attention to them. I understand the benefits of version control, but I'm worried about how it will respond to JSON.
const arr = [ 'red', 'green', 'blue', ];
It will become valid.
But what happens when you return the JSON syntax? JSON is supported by the RFC, so I doubt that JSON will ever support commas. Maybe one day..
But how does JavaScript handle the 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 do trailing commas interrupt everything?
source share