Escape Sequences in Strings\

Tell us what’s happening:

myStr should not contain any spaces
myStr should contain the strings FirstLine, SecondLine and ThirdLine (remember case sensitivity)
FirstLine should be followed by the newline character \n
myStr should contain a tab character \t which follows a newline character
SecondLine should be preceded by the backslash character \
There should be a newline character between SecondLine and ThirdLine
var myStr=“FirstLine”\t\n\“SecondLine”\n"ThirdLine"; // Change this line
var myStr=“FirstLine”\t\n\“SecondLine”\n"ThirdLine"; // Change this line

No Results

give me solution for it
Your code so far

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36.

Link to the challenge:

this will give you error because those Escape Sequences (\t, \n) should be inside the double quote ("")

it should be like this…

var myStry="FirstLine\nSecondLine\nThirdLine";

1 Like

thanks for your help