Escape Sequences in Strings in Javascript

here’s my code:

var myStr = 'FirstLine\n\\SecondLine\\\rThirdLine';

here’s the exercise:

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

i don’t know what i’m doing wrong… or right.

Take a closer look at the instructions.

FirstLinenewlinetabbackslashSecondLinenewlineThirdLine

you have the first new line correct. You need to give a new tab after that and a backslash.

After “SecondLine”, you just need new line before “ThirdLine”

lol. u da mannnnnnnn

To explain by example:

Code:

'string\nstring'

Result:

string
string

Code:

'string\tstring'

Result:

string    string

Code:

'string\\string'

Result:

string\string

Code:

'string\n\t\\string'

Result:

string
string    \

I think you should be able to understand the rest by that :slight_smile:

yeh i already got it. i was reading the instructions wrong