Tell us what’s happening:
Your code so far I
var myStr = "I am a "/double quoted/" string inside\"double quotes/".";
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 13421.89.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
.
Challenge: Escaping Literal Quotes in Strings
Link to the challenge:
You have a couple of issues:
j.kibera18:
"/
The escape character, /
, must come before the quotation mark.
j.kibera18:
\"
All of your slashes except for one are backwards.
var myStr = "I am a/"double quoted\"string inside"\double quotes\".";
This slash needs to be reversed and match all of the other ones.
j.kibera18:
am a/"do
This is incorrect. The slash needs to come before the quotes like mentioned earlier.
j.kibera18:
ide"\doub
Once you fix those issues then you have a spacing problem.
If you look at the console you should see this
Carefully examine your answer and compare it with the correct answer here
I am a "double quoted" string inside "double quotes".
Make sure the spacing looks exactly like the correct answer.
1 Like
var myStr="I am a\"double quoted/" string inside/"double quotes/".";
var myStr = "I am a/ "double quoted/" string inside / "double quotes/".";
I’ve edited your post for readability. When 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 it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
j.kibera18:
/ "
You cannot have a space between the slash and the quotation mark.
var myStr = "I am a\"double quoted/"string inside/"double quotes/".";//change this line
it does not seem as if I put a space in front of the slash and the quotation mark
I’ve edited your post for readability. When 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 it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
j.kibera18:
/"
You still have some of your escape characters (slashes) backwards.
which way is it supposed to be
var myStr = "I am a\"double quoted\"string inside\"double quotes\".";\\change this line
var myStr = "I am a\"double quoted\"string inside\"double quotes\".";\\change this line
I’ve edited your post for readability. When 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 it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
Ok, now you need to fix this issue:
jwilkins.oboe:
Once you fix those issues then you have a spacing problem.
If you look at the console you should see this
Carefully examine your answer and compare it with the correct answer here
I am a "double quoted" string inside "double quotes".
Make sure the spacing looks exactly like the correct answer.
Is it possible that you could tell me the exact mistake I am making, because the console is still providing me with the slashes and quotations marks
What do you see when you run
var myStr = "I am a\"double quoted\"string inside\"double quotes\"."; //change this line
console.log(myStr);
(also, why did you change the direction of the slashes for the comment characters? Comments start with //
.)
what are you trying to imply when you say “what do you see when you run”
var myStr = "I am a /"double quoted/"string inside/"double quotes/".";\\change this line