Freecodecamp Website Lesson Not Running a Test Result

Freecodecamp Website Lesson Not Running a Test Result
0

#1

I am working on the homework for this week, and when running a test on a question, the site will not run the test. Something is wrong. Help, please.

Link is below:

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings/


#2

You may have a syntax error in the code. Can you provide your code ?


#3

var myStr = \ I am a “double quoted” string inside “double quotes”.";
Also, even when I click the ‘Get a Hint’ button, nothing happens.


#4

Yeah, that doesn’t look correct. You want to have some kind of quotes around the whole string, either double or single.
Also review the lesson, because you need to escape the inside quotes to make this string valid.


#5

Hi, I’ve read the lesson again, is this correct?

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

#6

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.


#7

use the backslash to escape double quotes in the string. i-e

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

Anything inside double quotes is considered a string. So when we want double quotes to be part of the string, we use backslash\ which tells the parser that particular quote is not part of code


#8

No, your current attempt is not correct either. Remember, since you surrounded your string with " and ", if you want the string to contain an actual double quote, you must write \".


#9

@ridafatima15h1 Please provide hints, suggestions, and examples, but not full solutions. Thank you. Your code has been blurred to prevent spoiling the solution for the OP.