Basic JavaScript - Escape Sequences in Strings

Assign the following three lines of text into the single variable myStr using escape sequences.

FirstLine
\SecondLine
ThirdLine

You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above, with no spaces between escape sequences or words.

Note: The indentation for SecondLine is achieved with the tab escape character, not spaces

This is what I have so far: const myStr = “FirstLine\n\tab\SecondLine\nThirdLine”;
It says : myStr should only contain characters shown in the instructions
but it does, I don’t know what to do now?

please post a link to the challenge.

If I recall, there is no such thing as \tab?

Do you mean this:??

OOOh I get it, I wrote \tab instead of \t, I have got it now. Thank you!

1 Like

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