Escape Sequences in StringsStuck

Tell us what’s happening:

Your code so far


var myStr\t"FirstLine\nSecondLine\tThirdLine"; // Change this line


Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/escape-sequences-in-strings

First, you’re setting myStr\t... instead of myStr =.... Second, take a look at what it’s asking you to return:

FirstLine<newline><tab><backslash>SecondLine<newline>ThirdLine

But, rather than using the tags as I did, you want to change them:

<newline>     = \n
<tab>         = \t
<backslash>   = \\

So can you figure which of those go where in that string?

1 Like