Java script string interpolation vs comma


#1

in java script there is string interpolation so when we use console.log we use + to add them but cant we just use commas to separate them out?


#2

console.log() takes a comma separated list, but does not print the commas; it just prints everything on the same line, space separated.

This is not string interpolation, as such, but arbitrary ordering of output by the author. Concatenation is a form of string interpolation where we build a string by linking components together with +.

We haven't covered ES6 or later iterations, but more advanced string interpolation is introduced where strings are written with back-ticks instead of quotes.