Basic JavaScript - Escape Sequences in Strings

Tell us what’s happening:
Describe your issue here.
What’s wrong with my code. I followed all the instructions as given but I still didn’t get it write. Somebody help please.

Your code so far

const myStr = "FirstLine\n\tSecondLine\nThirdLine"; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Escape Sequences in Strings

Link to the challenge:

You lack a backslash after your tab.

“FirstLine\n\t\SecondLine\nThirdLine”; // Change this line
even after adding the backslash it didn’t work. See if you can find where I’m going wrong kindly.

That is not the correct way to add a backslash. Read through the notes provided in the lesson,you will see how to add a backslash.

Would you mind to do it for me…maybe that way I’ll know where I’m going wrong.

Unfortunately I can’t do that cause you won’t learn,I know it’s frustrating but with the frustrations comes great leaning. Which challenge are you facing.Let me see your updated code.

You add a backslash by using these characters \\

In case you can’t locate the character,it is just beside your enter keyboard button.

1 Like

const myStr = “FirstLine\n\t\SecondLine\nThirdLine”; // Change this line

This’s where I’m still stuck. Help kindly.

OK,your code has some quotes,I don’t know if I should call them so,those quotes do not resemble the normal double quotes I know,I had to change them while correcting your code.Furthermore,after your tab add a backslash,use the characters that I have shown you in the reply above.

OK thank you. I really appreciate. If I face another challenge I’ll let you know.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.