Constructing Strings with Variables help!

Tell us what’s happening:

Your code so far


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

// Only change code below this line
var myName;
var myStr;

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

Your browser information:

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

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

Do you see any errors in the console? It might help to add your solution piece by piece and watch for errors to pop up in the console.

Take another look at where and what your quotes are “quoting”. Look at var ourStr and see how your answer differs.

Also remember that they want you to build myStr, which you are not doing. sentence is not contemplated by the tests

can you explain better please, trying to figure it out to no avail

None of the instructions say to assign any value to a variable named sentence.

You have the first part of the instructions correct. You have assigned your name to the variable myName. Now you just need to assign a string to myStr which starts with “My name is " and ends with " and I am well!”. In the middle of this string should be your name. Since your name is already assigned to the variable myName, you should use it when constructing the string.

Tell us what’s happening:

Your code so far


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

// Only change code below this line
//var myName;
//var myStr;

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

Your browser information:

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

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

When concatenating a variable to another string you need to place the + operator between the variable and the string. See below for an example:

var stringVariable = "This is a part of a ";
var newString = stringVariable + "concatenated string.";

Thank you for your assistance. It worked!