Basic JavaScript - Escape Sequences in Strings

Tell us what’s happening:
Describe your issue in detail here.
const myStr=“FirstLine\n\t\SecondLine\\n\\ThirdLine”; // Change this line

Your code so far

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15

Challenge: Basic JavaScript - Escape Sequences in Strings

Link to the challenge:

it looks like you’re putting them on different lines, but the code should all be on one line. Recall that “\n” is a new line. That should be in your string.

Either that or you’re not escaping \n properly?

2 Likes