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:

add%20review%20video%20screenshot

This is what I did:

add%20review%20my%20screenshot

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:

add%20review%20video%20screenshot%202

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: