what is wrong with
var myStr = “I am a \“double quoted\” string inside \“double quotes\”.” ;
// Change this line
what is wrong with
var myStr = “I am a \“double quoted\” string inside \“double quotes\”.” ;
// Change this line
I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>
) will also add backticks around text.
Can you edit your posts with the 3 backticks as shown to you by @nsuchy? Both of your new solutions are using the curly double quotes so they are causing come of your problems. Also, both new solutions above have spaces in the wrong location. On the second new solution you posted above, you are missing the escape character before the double quotes (these are curly quotes but should be straight).
You should put a console.log(myStr); after the myStr assignment and then look at your browser’s console (Ctrl+Shft+J in Chome) to see what myStr actually looks like. Then you can see the spacing issues better.
What browser are you using? If using Chrome on Mac, then Command+Option+J opens the console for viewing. If your code has any of those curly double quotes, it will probably result in an error shown in your console.
FreeCodeCamp.org challenges work best on Chrome.
The following link explains how to set up developer tools on Safari.
When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>
) will also add backticks around text.
I formatted your code again. Please follow the above directions when pasting code into the forum. Otherwise, even if you have the straight double quotes, they appear as curly quotes You still have curly quotes showing, but I do not know if you put them there or the forum turned straight quotes into curly quotes. Also, you still are missing a space between certain words. The following is what myStr contains after your code runs.
I am a"double quoted"string inside"double quotes".
See the spaces missing between certain words an the double quotes?
I’ve edited your previous few posts for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>
) will also add backticks around text.