Basic JavaScript - Escaping Literal Quotes in Strings

Tell us what’s happening:
Describe your issue in detail here.
I have done this litterally 100 times i have looked up the right ansers. I believe i’m doing it right but it tells me i’m printing out the wrong thing. It comes out " I am a , then when i do it at the end sometimes the “.” whole thing shows up. please help!!!
i think because the " are showing up before the I am a and thats why. If i switch it then it makes my code wrong.
Your code so far

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

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14816.131.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic JavaScript - Escaping Literal Quotes in Strings

Link to the challenge:

I think you’re just missing a semi-colon at the end of your line. (Your post shows this:

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

and there is no ending semi-colon;)

nope thats not it either i tried that too. It says that i have the first part right but that my string dose not read the right thing . and when i run it it pops uo with the " in front of I am a . also it looks like the “.” shows up at end too . it has to be the " i am a I cant figure out how to get the " out from in frnt.

I think I remember that sometimes there are hidden characters when we copy and paste things in this environment.
Try typing the string out yourself from scratch. I can’t recall what was the hidden character that would sometimes get inserted with pasting, but that may be the issue.

Here’s the output:

I am a "double quoted "string inside "double quotes".

Here’s the expected output:

I am a "double quoted" string inside "double quotes".
1 Like

nope i didn’t copy and paste

thanks everyone for helping me try to figure this out

You need to delete the space after quoted, and add a space before string.

// console output
myStr = "I am a "double quoted; “string inside “double quotes.”.”
myStr = "I am a "double quoted; “string inside “double quotes.”.”

this is what im getting

For you to pass, your console needs to looks exactly like this:

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

What you shared above does not match that output, so you need to keep trying.

I know this im starting to think it is an error or something ill keep trying thanks for your help. when i did the spaces like you suggested it then said i was missing a semi colon , and when i add it it still says im missing one.

thank you all i got it , I think it was the spaces like you said I just didn’t change them right the first time.

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