You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 24, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+79-12
Original file line number
Diff line number
Diff line change
@@ -875,32 +875,99 @@ Forked from the excellent Airbnb JavaScript Style Guide, slightly modified to fi
875
875
};
876
876
```
877
877
878
-
- Additional trailing comma:**Nope.** This can cause problems withIE6/7 and IE9if it's in quirksmode. Also, in some implementations of ES3 would add length to an array if it had an additional trailing comma. This was clarified in ES5 ([source](http://es5.github.io/#D)):
878
+
- Additional trailing comma:**Yup.**
879
879
880
-
> Edition 5 clarifies the fact that a trailing comma at the end of an ArrayInitialiser does not add to the length of the array. This is not a semantic change from Edition 3 but some implementations may have previously misinterpreted this.
880
+
> Why? This leads to cleaner git diffs. Also, transpilers like Babel will remove the additional trailing comma in the transpiled code which means you don't have to worry about the [trailing comma problem](https://github.com/airbnb/javascript/blob/es5-deprecated/es5/README.md#commas) in legacy browsers.
0 commit comments