Basic JavaScript: Escaping Literal Quotes in Strings

I recently started working on the JavaScript course. I am unable find the error in my solution.

Question: 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".

My Solution:


var myStr = "I am a \"double quoted\" string inside \"double quotes\".";```

**Error Message:**
// running tests

You should use two double quotes (") and four escaped double quotes (\").

// tests completed

copy and pasting this pass the tests - try maybe reloading the page

Yea, it worked.

What I had done is:

var myStr = " ";
myStr = "I am a \"double quoted\" string inside \"double quotes\".";

don’t know why it was considered wrong.

It is probably because in this case the tests are checking exactly what you wrote, instead of just the value of the variable. As such it is valid only the solution on one line