A trailing comma is simply a comma that comes after the last item in our list. It’s not required, but in some instances in JS we’re allowed to put it there:

dishes, vacuum, tidy,

There are a number of reasons why you may want to include a trailing comma. Think about a scenario where you have to programmatically add elements to an array:

Without trailing commas, most values can be added to the array as value + ',' however you then need to add in special logic to ensure that last item added to the array doesn’t include a comma after it.

Since starting our work on Test262, the official test suite for the ECMAScript programming language, we’ve seen our fair share of strange tests. For nerds like us, every test has the promise to teach us something new, make us laugh, or bury our head in our hands. But unlike choosing between movies, books, or 18th century shoe makers, I’ve never had trouble picking a favorite JavaScript test.