Can anyone tell me what could be wrong with this? I am stuck here

Tell us what’s happening:
Describe your issue in detail here.

const myStr = “FirstLine\n\SecondLine\\n\tThirdLine”; // Change this line
Your code so far


const myStr = "FirstLine
\\SecondLine\\
\tThirdLine"; // 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/96.0.4664.93 Safari/537.36

Challenge: Escape Sequences in Strings

Link to the challenge:

Do you see the syntax errors below the editor window? These are telling you that your code is not typed correctly. You can’t add newlines to a double-quoted string by just adding additional lines. A double-quoted string must be one single line of text. You have to use the special escape character for new line (which is given in the table in the instructions) to put new lines in the string. The second line has a Tab at the beginning of it, so again, you must use the special escape character for tab.

1 Like