Where did i go wrong with this

Tell us what’s happening:

Your code so far

// Only change code below this line
var myName="My name is";
var myStr=myName +" and I am well!";

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-S737TL) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/11.1 Chrome/75.0.3770.143 Mobile Safari/537.36.

Challenge: Constructing Strings with Variables

Link to the challenge:

They clearly mention you should use 2 plus operators and you just using only 1.

var myName = "My name is";
var myStr = "Hi, " + myName +" and I am well!";

Set myName to a string equal to your name and build myStr with myName between the strings "My name is " and " and I am well!"
The myStr should equal to “My name is tamaricashaw13 and I am well!”, how can you achieve that by replacing your name with a varible inserted between two + operators?

It’s very easy.

var myName = "tamaricashw123";
var myStr = "My name is " + myName  +" and I am well!";

@rizimore Your code has been blurred out to avoid spoiling a full working solution for other campers who may not yet want to see a complete solution.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Thank you for understanding.

I am new to this forum but I don’t know. But next time I take care of it. I did not post solution I just correct this user solution which he already put in question.

So instead of automate message use mind.

@rizimore Welcome to the forum.

The problem is the code you posted passes the challenge, so that counts as posting a working solution.

Also, posting code and just saying “it’s easy” is not helpful to the camper. If you want to help, try to explain what is needed to pass the challenge without posting the solution. If you want to post example code make sure to change it enough that it does not work for passing the challenge but still shows the syntax and the basis of what is needed.

Besides the challenge already have an example that shows the syntax.

var ourName = "freeCodeCamp";
var ourStr = "Hello, our name is " + ourName + ", how are you?";
1 Like

Okay, brother am also new to this forum. Next time I take care.

1 Like