Tell us what’s happening:
Describe your issue in detail here.
Hello Coders,
Here is the task : Build myStr
from the strings This is the start.
and This is the end.
using the +
operator. Be sure to include a space between the two strings.
Here is my answer to the task :
const myStr = "This is the start. " + “This is the end.”;
console.log(myStr);
Then I get the result :
myStr should have a value of the string This is the start. This is the end.
After that I tried again with another method by using + operator and double quote " " for creating space between 2 sentences.
const myStr = "This is the start. " + " " + “This is the end.”;
console.log(myStr);
And I get the result :
myStr should have a single space character between the two strings.
myStr should have a value of the string This is the start. This is the end.
I thought I have done the task correctly . Anyone know what I have done wrong here?
Happy coding!
Your code so far
const myStr = "This is start. " + "This is the end";
console.log(myStr); // Change this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Concatenating Strings with Plus Operator
Link to the challenge: