Sequences in Strings

Tell us what’s happening:
Describe your issue in detail here.
In this task, I am having trouble recognizing what I have done wrong. After watching the video and applying the information step by step I am still getting the entire code wrong. I can’t seem to identify the issue, so I was hoping a different pair of eyes would be able to seek the problem. Here is what I’ve done:

var myStr;“FirstLine\n\t\SecondLine\nThirdLine” // Change this line

Your code so far


var myStr;"FirstLine
\t\\SecondLine
ThirdLine" // Change this line

Your browser information:

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

Challenge: Escape Sequences in Strings

Link to the challenge:

So the var myStr creates a variable (or declares or instantiates, they all mean we make a variable), and the semicolon (the ;) ends the statement. Then you have a string, with escape sequences.

Should your semicolon be an equal sign? Are you trying to assign that value to the variable?

1 Like

As @snowmonkey has mentioned, It looks to me that you are initializing a variable but not assigning that variable any distinct value.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.