Basic JavaScript: Concatenating Strings with the Plus Equals Operator

Basic JavaScript: Concatenating Strings with the Plus Equals Operator
0

#1

Tell us what’s happening:
i couldn’t find out any prblem here… but why it’s not working?

Your code so far


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

// Only change code below this line

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


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0.

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


#2

Here is what’s wrong.

You are missing a period and you are also adding a space after sentence.


#3

it’s still not working :frowning:


#4

Can you share your code?


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

// Only change code below this line

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

#6

It looks like your double quotes are not real double quotes.

Make sure you are using this quotation. "


#7

i did it as like as similar as the task … but still it’s not working … whatever thanks a lot dear … :slight_smile: am trying to find out


#8

You need to have a space in the first string after period.

var myStr = “This is the first sentence.”;


#9

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.

@shimphillip When someone posts code with single or double quotes into the forum without using the 3 backticks mentioned above, then the forum software displays them as a curly version of the original.