Escape Sequences in Strings Answer

Tell us what’s happening:

Your code so far

var myStr; // Change this line

var myStr = "FirstLine\n\t\\SecondLine\nThirdLine";

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36.

Link to the challenge:

how do we answer that?

They aren’t asking you to answer literally. They are asking you to change that code to make it work properly.

Delete anything that is not javascript and just change the code where indicated to assign your string to variable myStr. When you click the “Run the Tests” button your javascript will be tested to see if your string is as required.

1 Like