The result shows " You should use two +
operators to build myStr
with myName
inside it."
I don’t get it. Don’t I use two “+” already?
Thank you for helping in advance.
Your code so far
// Only change code below this line
const myName = "Will";
const myStr = "My name is " + "myName" + " and I am well!";
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Constructing Strings with Variables
Link to the challenge:
cmar
April 21, 2023, 4:16am
2
It may be the spaces you are putting before the quotes that are throwing the tests off
1 Like
sanity
April 21, 2023, 4:23am
3
Take another look at the example. The myName
variable should be used in myStr
to include the actual value of the string. Not to make it “My name is myName and I am well!”
1 Like
I still don’t get it.
I define variable myName already.
Then I follow the insturction, use “+” operator to combine those string.
The insruction is " 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!
"
So I set Variable myName=“Will”
and set Vairable myStr = “My name is " + “myName” + " and I am well!”
Where did I misunderstand the insruction? Need help please.
Thank you everybody.
I found out the bug.
I don’t need to " " the variable, which I “” myName variable in my myStr.