Escape Sequences in Strings#2

Tell us what’s happening:

What am i doing wrong?
i don’t know where to put the tab character \t and the newline character between secondline and thirdline is missing.

Your code so far
var myStr= “FirstLine\n\SecondLine\\rThirdLine”

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

Your browser information:

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

Link to the challenge:

Slow down, you’re confusing yourself. Look at the instructions.

Here is the text with the escape sequences written out.

FirstLine `newline` `tab` `backslash` SecondLine `newline` ThirdLine

So everywhere you see newline, you need to use the newline escape code. Where you see tab use the tab escape code, and where you see backslash use the escaped backslash code.

Also note that, while the string shows spaces between the words and codes, it doesn’t want them.

Ok, thank you, your way makes sense. So how come when i look up the youtube tutorial it shows you differently and it tells you differently unless its an older version of free code camp.

Honestly, I haven’t looked at the youtube tutorials. I went through the lessons, took them at face value, and poked at them till they passed. :wink:

I still think im typing it in wrong. ill keep trying at it.

What is your exact string? Enter it here, surrounded by backticks (the key over the tab, the accent mark).

I figured it out. Thanks tho.