Hahaarg ive been trying for ages plz help, (JavaScript)t

ok, so im doing this lesson called: Escaping Literal Quotes in Strings. and I cant seem to do of the things required to continue,

someone please help and tell me what the hek I’m doing wrong.

my code so far

const myStr = "I am a "double quoted" string inside "double quotes""; 

Challenge: Escaping Literal Quotes in Strings

Link to the challenge:

You need to escape all of the double quotes inside the string by placing a backslash \ before them, just like in this example from the instructions.

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

like this?

const myStr = “I am a /“double quoted” string inside /“double quotes”.”;

Closer… But you need to use a backslash \, not a forward slash /. And you need to place that backslash in front of every double quote inside the string - you missed two.

i’ve got the slashes in the right place i think but now its questioning my spelling skills lol : const myStr = "I am a “double quoted” string inside “double quotes”;

Looks like you’re missing the period.

ohmy goshhhhh haha thanks that did it!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.