Why are " " + variable in the code


#1


I'm just trying to find out why the " " + variable is necessary. just curious...


var foodDemand = function (food) {
    console.log("I want to eat" + " " + food);
};


#2

Is it? How are you able to start with the premise that it is necessary?


#3

I have the same question. The + operator should have returned syntax error as we couldn't add two strings.
I remember it from first few lessons.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.