+ operator javascript issue

Tell us what’s happening:
actuall im using the + operator but the compiler doesnt detect that

! Your code so far


// Example

// Only change code below this line

var myStr="This is the start." + " This is the end.";

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36.

Challenge: Concatenating Strings with Plus Operator

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator

The original problem has the starting code of

// Example
var ourStr = "I come first. " + "I come second.";

// Only change code below this line

var myStr;

It looks like you’ve acciendtally remove the variable ourStr. If you Reset All Code and then only create the myStr variable, you should be able to complete the challenge.

1 Like

Watch out for the spacing.

Please note: Spacing between the quotation mark and the text is equivalent to adding space in the browser output.
Your code should basically look like this:

var ourStr = "I come first. " + “I come second.”;

In your own case, you added a space to the beginning of second statement instead of you adding it to the end of the first statement.

1 Like

thanks bro worked like a charm

didnt work !! but thanks for your time

Oops!!!, edited.

Copied the code we have in the example.
Glad, you have your test passing.