Variable should have a string

Tell us what’s happening:
Describe your issue in detail here.

Your code so far


// Only change code below this line

var myStr  =  "This is the first sentence."
myStr +=  "This is the second sentence. "

console.log(myStr);

i dont know why in the output its showing that myStr should have a value of a string. can someone help me in this as the var myStr is already in string double quotes.

Your browser information:

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

Challenge: Concatenating Strings with the Plus Equals Operator

Link to the challenge:

Hi @waniahmed3 !

Welcome to the forum!

You have two spacing issues.

No.1:
You need to add a space here in the first sentence.

If you look at the console it currently says this.

There needs to be a space between the first and second sentence.

No.2:
You added an extra space at the end of your second sentence.

Get rid of that and the test will pass.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.