+ 2
When to use plus (+) and comma (,) inside a console.log in javascript?
Hello, I came to a part in my javascript tutorial wherein I was introduced with a comma (,) for somewhat like a string concatenation. I thought I can only use + when joining strings or variables. Here is the example code. let weather = 'sunny' console.log('The weather today is ' , weather) Result: The weather today is sunny. Using the + sign will produce the same results. I just want to know when to use the right operator. This may have been introduced in the earlier part of the tutorial but I completely missed this out. Thank you for the help.
1 Respuesta