Escaping Literal Quotes in Strings2

how can i write the literal quotes in string?

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

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

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:

Step 1: Assign an empty string to a variable like this
var myStr = "";
Step 2: Write anything in between those double quotes like this
var myStr = "I am a "double quoted" string inside "double quotes".";
Step 3: Place a \ just before any quote you find like this
var myStr = "I am a \"double quoted\" string inside \"double quotes\".";
and you shall pass!

1 Like

Ah ok thank you :slight_smile: I got it !