Search code examples
javascriptescapingstring-literals

Learning JavaScript Basics


Help me correct "Escaping Literal Quotes in Strings" click this for the code>> https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings

I am just trying this on free code camp and I'm stuck with the part that involves placing single quotes or double quotes inside a string literal


Solution

  • The solution is this:

    const myStr = "I am a \"double quoted\" string inside \"double quotes\".";
    

    Use the backslash before the " to escape it.I hope this can help :)