Spurious comma when concatenating strings using array.join()

I noticed something odd in the lecture “Update Operators”, when adding a review to a movie. This is what the video says to do:


This is what I did:


At the point where the two elements of the string array were joined together, there’s an extra comma which isn’t intended. It looks like the same thing happened in the video too:


Any idea why this happens?

You refer to the MDN documentation here.

Calling .join() without a parameter defaults to using “,” as a delimiter when joining the texts. To get rid of the commas, use .join('') instead.

Ah yes, reading the documentation always helps :slight_smile: