var x = “Hello “;
var y = “World!”;
var i = x + y;
// value of i would be Hello World!
Looking at the above example, you might be wondering how we would go about adding a space between the words? Have a go yourself in your console and see if you can work out a good way of achieving this.
Have you had a go yet? Great, let’s look at the solution. We simply use a string containing a space. We can do this inside one of the variables, like so: