In JavaScript, you can escape a quote from considering it as an end of string quote by placing a backslash (\
) in front of the quote.
Use backslashes to assign a string to the myStr
variable so that if you were to print it to the console, you would see:
const myStr = "I am a \"double quoted\" string inside \"double quotes\"."; // Change this line
Was this article helpful?
YesNo