New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing commas #2182

Open
BobStein opened this Issue Dec 31, 2015 · 3 comments

Comments

Projects
None yet
5 participants
@BobStein

Suggestion:

 //caniuse.com/#feat=object-literal-trailing-comma
 //caniuse.com/#feat=array-literal-trailing-comma

...or something.

Trailing commas in JavaScript object or array literals have vague scary warnings against.

The following resource identifies IE8,IE7,IE6... as the only browsers to worry about for trailing commas in object literals:

Is that true? Is it complete? What about array literals? JSON.parse? jQuery.parseJSON?

@tvler

This comment has been minimized.

Show comment
Hide comment

tvler commented Jul 27, 2017

+1

@danielchasehooper

This comment has been minimized.

Show comment
Hide comment
@smwa

This comment has been minimized.

Show comment
Hide comment
@smwa

smwa Feb 15, 2018

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas mentions that JavaScript has allowed trailing commas in arrays since the very beginning, but I agree that it could be useful to have a feature "Trailing Commas In Objects"

smwa commented Feb 15, 2018

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas mentions that JavaScript has allowed trailing commas in arrays since the very beginning, but I agree that it could be useful to have a feature "Trailing Commas In Objects"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment