I don't know what is wrong with this code

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

This is your challenge:

And here it tells you what to do:

Use backslashes to assign a string to the myStr variable so that if you were to print it to the console, you would see:

I am a "double quoted" string inside "double quotes".

And here it tells you how to do it:

In JavaScript, you can escape a quote from considering it as an end of string quote by placing a backslash ( \ ) in front of the quote.

const sampleStr = "Alan said, \"Peter is learning JavaScript\".";

And this would be the answer:

const myStr = “I am a “double quoted” string inside “double quotes”.”

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