Basic JavaScript - Concatenating Strings with Plus Operator

Tell us what’s happening:
Describe your issue in detail here.
Hello Coders, :raising_hand_woman:
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:

This is the start.
Not
This is start.

1 Like

Thank you for spotting the missing letter. I have just added it to the sentence and ran the code. I still get the same result. Hopefully the answer is found soon.

For your contribution to my post :coffee:

:smiley_cat:

You are welcome. Make sure you have the requested punctuation (period at the end of each sentence) and also fix the spaces to match exactly.

1 Like

You are super spotter :raised_hands: I have just add period and the code run like magic.
My problem is always reading fast the text content.
Thank you very much and happy coding!
For you :cake:

:smiley_cat:

1 Like