Escaping literal qoutes in javascript

Tell us what’s happening:

I get this Error ( Variable myStr should contain the string: I am a "double quoted" string inside "double quotes".) I don’t see any mistakes in my code. can anyone help me with this. Thank You.

Your code so far



var myStr = " I am a \"double quoted\" string inside \"double quotes\"."; // Change this line
console.log(myStr);

Your browser information:

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

Challenge: Escaping Literal Quotes in Strings

Link to the challenge:

Hello!

Welcome to the forum :grin:!

Your code is right, it’s just that the challenge is a little picky. Just remove the extra space at the start of your string:

// Your original string
//  var myStr = " I am a \"double quoted\" string inside \"double quotes\"."; // Change this line
// Without the extra space:
var myStr = "I am a \"double quoted\" string inside \"double quotes\"."; // Change this line

console.log(myStr);
1 Like

Thank You. It worked, and thank you again.

1 Like