Jesse Nuese Jesse Nuese - 2 months ago 6
Javascript Question

Space between string & variable in Javascript

How can I make this return "Hello yourName" as opposed to "HelloyourName"?

var yourName=(prompt("What's your name?"));
alert("Hello" + yourName);


Thanks for the answers guys, this was helpful.
Can anyone explain to me why this was downvoted/was not a good question?

Answer
var yourName=(prompt("What's your name?"));
alert("Hello " + yourName); // "Hello " with space