Escape Sequences in Strings (NOT WORKING!)

Escape Sequences in Strings (NOT WORKING!)
0

#1

Tell us what’s happening:

Your code so far

var myStr = "FirstLine\n\SecondLine\\rThirdLine"; // Change this line

I typed in the correct code and it is not letting me pass on to the next challenge

Link to the challenge:


#2

Remember, to display an actual \, you must put another \ in front of it to escape it.


#3

Which one should I fix?


#4

If you want to display a \ in front of the word SecondLine, you will have to use \\ to do it.


#5

I really don’t know how to do it

This is what I have now:

var myStr = “FirstLine\nSecondLine\rThirdLine”; // Change this line


#6

The code you posted above produces:

FirstLine
SecondLine
ThirdLine

The challenge wants:

FirstLine
\SecondLine\
ThirdLine

Your code does not display the two \ because you are not escaping them with another \