Basic JavaScript - Concatenating Strings with the Plus Equals Operator

Tell us what’s happening:
Describe your issue in detail here.
I have complete this section before but reset it to double check my understanding. This time when I write the code it insist that I nee a single space between the strings. I’m sure I have a space between the full stop and the double quotation at the end of the first string. What is incorrect here?

Your code so far
let myStr; "This is the first sentence. "

myStr += “This is the second sentence.”

let myStr; "This is the first sentence. "
myStr += "This is the second sentence."

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.60

Challenge: Basic JavaScript - Concatenating Strings with the Plus Equals Operator

Link to the challenge:

Hello!
There is something missing at the end of both sentences.

let ourStr = "I come first. ";
ourStr += "I come second.";

This is the example from the lesson. Do you see what is at the end of each one?
We all have missed them sometimes.
Keep up the great progress this time around, too. :slight_smile:

2 Likes
let myStr; "This is the first sentence. "

You are missing the assignment = here.

1 Like

Here this example from the lesson will help you see the way to do it.

let ourStr = "I come first. ";
ourStr += "I come second.";

I used the example as a reference to pass it.

1 Like

Damn I feel dumb! Thanks a lot, I’ll be sure to remember to do this from now on!

Thanks very much, still learning the curves of this whole thing.

1 Like