Console is logging the wrong output in "Escaping Literal Quotes in Strings" lesson

Tell us what’s happening:
The output should be const myStr = I am a “double quoted” string inside “double quotes”.

Your code so far

const 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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36

Challenge: Escaping Literal Quotes in Strings

Link to the challenge:

The initial code is:

const myStr = "";

You changed those double quotes to single quotes. The error is telling you to change them back to double quotes.

Also, you have an extra space after the period.

1 Like

even if I write this code: const myStr = "I am a \"double quoted\" string inside \"double quotes\". ";
this is the console output: "I am a “double quoted” string inside “double quotes”. "
The double quotes at the beginning and end of the string are being printed.

As @bbsmooth has noted, you have an extra space after the period.

Ok I will remove the extra space and try… Thanks to you both.

The double quotes wrapping the entire string is just the console telling you it is a string. The console puts them there, not you.