Basic JavaScript - Escape Sequences in Strings

hola

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

hola estoy en este punto y no se cual es el error

Your browser information:

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

Challenge: Basic JavaScript - Escape Sequences in Strings

Link to the challenge:

SecondLine should be preceded by the backslash character \

Does the output printed to the console pane have a backslash before SecondLine? I know you have one backslash before SecondLine in your code, but that’s not what is important. It needs to be there when printed to the console. What do you think you need to do to get that backslash to print to the console? (I would read the instructions again because it tells you exactly how to do this).

\Thirdline

First, you didn’t quite type this right. The letter l should be uppercase. Also, the backslash before the letter T is doing nothing. You only need a backslash when you want to use special escape characters, such as the \n before ThirdLine to create a newline. But \T isn’t a special escape character and thus you can just get rid of that backslash.

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