I've removed the backslashes but still error

Tell us what’s happening:
Describe your issue in detail here.

Your code so far


var myStr = '<a href="https://example.com" target="_blank"> Link. </a>'

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Challenge: Quoting Strings with Single Quotes

Link to the challenge:

Hint - Hmm may I ask why did you delete the “www” ?

Also, you have added, “s” to the “HTTP” which in the original task was not included. Hope this will help. Adios amigos :grin:

Yes, I’ve fixed it all hahaha but my problem is with the backslashes thing. Why is it?

Would you mind showing your updated code so we can have a look and help you?

in most cases across programming languages, backslashes are a way to tell the computer, hey, the character after me if has a special meaning, ignore it, if it doesn’t have a special meaning, make it so that it does.
Example:
when assigning value to a string, " ordinarily would cause the computer to close/start a double quote enclosed string. But \" would cause the computer to treat that specific " as just an character.

n by itself in a string is just that, n. But \n in a string would cause the computer to break new line between the string before and after.

Hopefully that’s what you wanted to know!

1 Like

Here’s the code, is it correct? I’ve removed all backslash
var myStr = '<a href="http://www.example.com" target="_blank"> Link. </a>';

I’ve logged both your string and the original string, they are not the same string anymore (look at the console!) so the tests are confused and fail

what is this uninvited full-stop doing before </a> tag?? :face_with_monocle: :face_with_monocle:—>". "’; get rid of this and then you are all good mate.

AHA, it works! Thank you!!!

Pada tanggal Rab, 15 Sep 2021 pukul 18.12 Come4tmiBRA via The freeCodeCamp Forum <freecodecamp@discoursemail.com> menulis:

Your Most Welcome Homie… :vulcan_salute: