Basic JavaScript - Escape Sequences in Strings

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

var myStr =“nFirstLine\n\t\SecondLine\nThirdLine”; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0

Challenge: Basic JavaScript - Escape Sequences in Strings

Link to the challenge:

Hi everyone!

Please can anyone help out here? I think my code is correct but don’t really know is wrong.

my code below:

var myStr =“nFirstLine\n\t\SecondLine\nThirdLine”; // Change this line

There are two mistakes, you do not want to change the line for the word “FirstLine” hence you do not need to use any escape character before the word and there is a backslash at the beginning of the word “SecondLine” in order to include it in the string you just need to escape one of the backslash before the word “SecondLine” with another backslash.
Try to read the Note statement in the challenge carefully.
Thank you.

1 Like

Thank you.

I got it now

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