Escaping Literal Quotes in Strings "Error"

Tell us what’s happening:
Error: Variable myStr should contain the string: I am a “double quoted” string inside “double quotes”.

Your code so far


var 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/67.0.3396.87 Safari/537.36 OPR/54.0.2952.51.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings

There are comma and a space after the comma that make that string different from the original ^^
Remove those and it will be fine ^^

with or without the spaces it not working i’m lost

“I am a,“double quoted"string inside"double quotes”.”;

Tell us what’s happening:
1 right = var myStr = “I am a, “double quoted” string inside “double quotes”.”;
2 wrong = Variable myStr should contain the string: I am a “double quoted” string inside “double quotes”.

What am i doing wrong?

Your code so far


 var 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/67.0.3396.87 Safari/537.36 OPR/54.0.2952.51.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings

remove the comma after the ‘a’

Thanks! You are very helpful.

1 Like