freeCodeCamp Challenge Guide: Escape Sequences in Strings

These lesson clearly says that

FirstLine newline, backslash SecondLine backslash , carriage-return ThirdLine

It clearly show’s that we must first write:-
var myStr = "FirstLine\n\\SecondLine\\\rThirdLine"

After writing FirstLine \n which mean new line as given above followed by \SecondLine\ in order to escape from \ we use \ before and after of \SecondLine\ thus it become \SecondLine\and lastly carriage-return which is\r` followed by ThirdLine.

65 Likes