One of the better ways I&#x27;ve seen of dealing with this, generally used in SQL which is one of the less lenient languages I&#x27;ve seen, is to prefix new lines of the list with commas.  That is, when constructing a list using multiple lines (which is where the trailing comma is most problematic), the first line is not prefixed with a comma, and all subsequent lines are.<p>E.g.<p><pre><code>    var foo = [
      &quot;aa&quot;
      , &quot;bb&quot;
      , &quot;cc&quot;
    ];
</code></pre>
The usefulness of this may not be readily apparent in this simplistic example, but when the term is complex or spans multiple lines, it becomes useful both as an indicator of a new term starting, and in that identifying the end of a large term often isn&#x27;t nearly as easy as identifying that start.<p>E.g.<p><pre><code>    var foo = {
      attr1: &quot;foo&quot;
      , attr2: &quot;bar&quot;
      , method1: function() {
      }
      , method2: function() {
      }
    };
</code></pre>
I&#x27;ll admit I don&#x27;t often use this technique.  Most commonly it is with large custom SQL queries, which themselves are fairly uncommon for me.  That said, SQL often lacks the mitigating techniques that make this less useful in common programming languages (such as computing complex terms ahead of time and assigning the result, gradual building of data structures, etc.).