Modern JavaScript
About Lesson

It is JavaScript lesson we are going to learn about JavaScript Trailing Commas, so trailing commas comes at the end of the last item in a list, and it is a feature in JavaScript ES8.

 

 

Now let’s create an example, so you can see that after our last item in the array, we have added a comma, and there is no problem with this syntax, and we will not receive any error, because it is a feature in JavaScript ES8.

 

 

 

Also you can add training commas in a function, you can see in the function after adding the second parameter we have added a comma and this is a valid syntax.