Basic JavaScript - Escaping Literal Quotes in Strings

dont know what’s wrong

var myStr = I am a “double quoted” string inside “double quotes”;

console.log(myStr)

var myStr = I am a "double quoted" string inside "double quotes";
console.log(myStr)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Safari/605.1.15

Challenge: Basic JavaScript - Escaping Literal Quotes in Strings

Link to the challenge:

You need to enclose the string in either single quotes (') or double quotes (") and any double quotes within the string should escaped using a backslash (\).Use backslash in front on the double quotes(\" ...\") to Escape Literal Quotes in Strings.

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