Escaping Literal Quotes in Strings assistance

Tell us what’s happening:

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 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.

Link to the challenge:

A very small mistake.

You forgot the Full Stop (.) at the end of the sentence.

##It still not working sir

You are probably doing something wrong.

Before the closing quote (") add a full stop (.)

And it will work.

##it doesn’t please sir what else am i getting wrong?

Can you reply back with your latest code attempt?

To you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.


English sentences start with a capital letter and end with a full stop.

Are you doing that?

Your code: var myStr = "I am a \"double quoted\" string inside \"double quotes\""; doesn’t contain that point that indicates the end of the sentence.

If you console log myStr, you will get: I am a “double quoted” string inside "double quotes"
Try to compare it with this: I am a “double quoted” string inside “double quotes”.

is it the same?

No, there’s a slight difference.

var myStr= " I am a  \"double quoted\" string inside \"double quotes\. ""; // change this line

3 problems:

  1. You have an extra double quote

  2. After the word quotes, there should be a literal doublequote.

  3. You have a space character after the period which should not be there.

  1. You are putting the Full Stop in the wrong place. It should be at the end before the final, closing quote ("): ."

  2. There shouldn’t be any space around double quotes: \"double quotes\"

It’s very easy bro.

var myStr = "I am a \"double quote\" string inside \"double quotes\"."; // Change this line

am still having problems with this same code, i have tried all that i was asked to do to get it right, both there shouldn’t be any spacing around the double quotes: yet it still not working out. Please am so confused and tired

Your code is right.
You have a typo in your code.
This is what the challenge wants you to have:
I am a "double quoted" string inside "double quotes".

And this is what you have:
I am a "double quote" string inside "double quotes".

Can you spot the difference?

Thanks it was a success

1 Like