Basic JavaScript - Escaping Literal Quotes in Strings

Tell us what’s happening:
Describe your issue in detail here.

Your code so far
it gave me this message
Variable myStr should contain the string: I am a “double quoted” string inside “double quotes”.

const myStr = “I am a "double quoted " string inside " double quotes ".”; // Change this line
what’s wrong with my answer?


**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36</code>

**Challenge:** Basic JavaScript - Escaping Literal Quotes in Strings

**Link to the challenge:**
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings

How will JS know that you’re string isn’t ending at "I am a "

All the quotes look the same, how will it know which to print out and which terminate your string?

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