title: How can I throw an error in JavaScript with trailing commas?
body: <p>I know that <code>'use strict';</code> will throw some extra errors. However, they do not seem to include trailing commas. </p>
  
  <p>I want something like the following to throw an error since I just spent several hours diagnosing failed poltergeist specs due to this. Firefox and Chrome do not have a problem with this. </p>
  
  <pre><code>function personRow(person) {
    $row = $('&lt;tr&gt;');
    person_url = 'https://directory.weill.cornell.edu/person/profile/' + person.weillCornellEduCWID;
    $row.append(
      $('&lt;td&gt;', { html: mailTo(person.mail) }),
      $('&lt;td&gt;', { html: phoneTo(person.telephoneNumber) }),
    )
    return $row;
  }
  </code></pre>
  
  <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas</a></p>