Modern browsers ignore unneeded, trailing commas, so there are no negatives to having them unless you're supporting an IE 8 application. Since they make adding new properties simpler, their use is preferred. This rule raises an issue when the last item in an object declaration or array declaration does not end with a trailing comma and does not lie on the same line as the closing curly brace or bracket.

Noncompliant Code Example

var joe = {
  fname: "Joe",
  lname: "Smith"      // Noncompliant
};

Compliant Solution

var joe = {
  fname: "Joe",
  lname: "Smith",    // OK
};

var joe = {
  fname: "Joe",
  lname: "Smith"};   // OK