Why is the space in Intro to Functions in quotes on its own?


#1

In the Intro to Functions course, the examples put the space between the text to print and the variable in quotes by itself. Why not just add in the space at the end of the first string?

In other words

WHY THIS:

console.log("I want to eat" + " " + food)

INSTEAD OF THIS:

console.log("I want to eat " + food)

#2

@websurfer95994,
It is just meant as an example of string concatenation...


#3

Thanks @leonhard.wettengmx.n - is there any reason to ever do the first option over the second?


#4

@websurfer95994,
I could only imagine one like
var comment = "I want to eat";
console.log( comment + " " + food);