Concatenating Strings

Concatenating Strings
Tell us what’s happening:
Condition: myStr should have a value of This is the start. This is the end.
.
.
.
.
Below is my javaScript code:

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

// 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36.

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

1 Like

I did not checked the challenge itself ( since you haven’t linked it :stuck_out_tongue: ) but, just wondering, is there a space between the final dot of the first sentence and the quote?

1 Like

You need a space dude after ...start " or before " This..

1 Like

It’s concatenating of 2 strings and i did tried by adding space but it’s still not working.

have you tried refreshing your browser? and starting the challenge again?

Its not working I tried.

yes Still not working

have you tried using a different browser? or could you post your code?

Correct Code:
// Example
var ourStr = "I come first. " + “I come second.”;

// Only change code below this line

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

I tried the exact code in my browser and it passed without any problems. This is what I typed.
var myStr = "This is the start. " + "This is the end.";

Are you using ‘chrome’?

3 Likes

you might need to put a space between the assignment operator like this myStr = "This because freecodecamp is very picky with everything.

1 Like

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums

1 Like

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


I have gone through that and I think you have the correct answer but you have issues with spacing in your code: 
Here is what I did:

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

Pay attention to the spacing between the first section and the next. Happy coding!