Escape Sequences in Strings\

Escape Sequences in Strings\
0

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
123
var myStr=“FirstLine”\t\n\“SecondLine”\n"ThirdLine"; // Change this line
var myStr=“FirstLine”\t\n\“SecondLine”\n"ThirdLine"; // Change this line

Find
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:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/escape-sequences-in-strings

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