Quarantine Basic JavaScript: Escaping Literal Quotes in Strings in 2020

Tell us what’s happening:

None of the suggestions are working for me, I ve tried them and watched the video. Can anyone Identify the issue for me

Your code so far


var myStr ="I am a /"double quoted"/string inside/"double quotes"/".";
consolelog(myStr)

This is the error message I get
SyntaxError: unknown: Unexpected token, expected “;” (1:20)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36.

Challenge: Escaping Literal Quotes in Strings

Link to the challenge:

I believe the problem is a simple typo. You have forward slashes used in the code you gave, but you need to use backslashes for it to work properly.

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

Hope this helps! Cheers!

Hey thanks I appreciate it!

1 Like