Tell us what’s happening:
This exercise wants you to make a string that looks this:
FirstLine
\SecondLine
ThirdLine
What I don’t understand from the answer given is that, why after “FirstLine” you use a “\n” but after “\SecondLine” you use a “\r”? How can you tell the difference whether the ending of a line is “\n” or “\r”? And how do you decide when to use which?
Your code so far
var myStr="FirstLine\n\\SecondLine\\\rThirdLine"; // Change this line
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/escape-sequences-in-strings