Can i use , to do String Concatenation function instead of the + operation?

I understand that we can use + operation to do string concatenation. However, can we use, comma do to string concatenation?

let myPet = 'armadillo';
console.log('I own a pet ' + myPet + '.'); 

How about?

let myPet = 'armadillo';
console.log('I own a pet' , myPet ,  '.'); 

the comma (,) doesn’t concatenate a string. The comma just let the log method print multiple arguments.

1 Like