javascriptstringspace

How do i put a space between my two strings?


Sorry if this question is to basic but how do I put a space in-between my two strings using JavaScript ?

The code in question is the following

console.log ("myFirstString + mySecondString =  " + (myFirstString +  mySecondString));

The out put is coming out as "myFirstString + mySecondString = MikeSlett"

I need there to be a space between Mike and Slett soo it reads " Mike Slett".

Thanks for any help!


Solution

  • myFirstString + " " + mySecondString