Escaping Literal Quotes in Strings 2018

Tell us what’s happening:

Your code so far


var myStr = "I am a, \"double quoted" string inside "double quotes\"."; // Change this line







Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings

I don’t know what I am doing wrong

You don’t have enough backslashes. Each double-quote inside the string needs to have a backslash before it.

"
That is a double-quote character.

1 Like

Thank you, I figured it out

2 Likes

When your overall string is surrounded by " ", then any double quote you want to actual appear in the string, must be escaped with the \ character. You are missing two \ characters. Also, you put a comma after I am a which is not part of the required final string in the instructions.

1 Like