Tell us what’s happening:
Describe your issue in detail here.
Your code so far
var myStr = ""; // Change this line
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Challenge: Escaping Literal Quotes in Strings
Link to the challenge:
Do you have a question?
If so, please edit your post to include it in the Tell us what’s happening section.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more information you give us, the more likely we are to be able to help.
I need to know how exactly this answer should be: With the backslash or just the quotation marks only?
You need to use the escape character.
What´s wrong here :
var myStr = ""; // I am a \"double quoted"\ string inside \"double quotes"\.;
Your variable shouldn’t be changed to
var instead of
const. Also, you put the string in a comment instead of assigning it to your variable.
The answer would include both the backslash and the string
Use backslashes to assign a string to the myStr variable
You don’t need to change the declarative variable, let the const remain as it is.
so just assign the string to the variable, then escape the strings with the backslash
To escape the string, the backslash has to come before each quotation mark you are trying to escape
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.