Error with semicolon

What is wrong with this code?

Your code so far

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

The error description was:
SyntaxError: unknown: Missing semicolon. (1:22)

1 | var myStr = “I am a /“double quoted/” string inside /“double quotes /”.”;
| ^
2 | console.log(myStr);
3 | // Change this line

The issue is that it can’t correctly parse that line. You’ve used forward slashes (/) to escape in your string, but it needs to be backslashes (\).

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

So I did but still I doesn´t work

You have spaces in there, you need \", not \ ".

If that doesn’t help, then please also provide a link to the challenge, so we can help you better.

Thanks, it is working now

1 Like

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