Quoting strings with single quotes JS

Challenge is basic javascript - javascript algorithms and data structures

This is the challenge example

const myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>";

challenge states to remove the backslashes and code should have 2 single quotes and 4 double quotes. which i did in the example below.

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

when i click run test. nothing happens. according to comments on this particular lesson, its correction solution. is there something wrong with the setup?

thank you for the replies.

Hi @JNguyening,

Welcome to freeCodeCamp and JS! It seems that you are using a different symbol than its looking for, you are using , but it expects '. A slight difference in characters can cause issues in code unfortunately.

Hope this helps!

Which challenge is it?

Also, this is particularly important here: when you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

As well as making it difficult to rea, of you don’t do this, a. quotation marks will be formatted as actual quotation marks in the post and b. if you type anything that looks like HTML, the forum will try to render that HTML .

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

thank for the warm welcome. im grateful to be a part of this community. i’ve learned so much since i’ve joined! yes it does look like it but i am using ( ’ ).

ths is the challenge link.

I am so sorry! I had a filter active that prevented popups. That’s why I couldn’t get anything to work! I’m sincerely sorry I wasted your time.

1 Like

I am so sorry! I had a filter active that prevented popups. That’s why I couldn’t get anything to work! I’m sincerely sorry I wasted your time!

1 Like

At least it’s an easy fix, and it wasn’t your code that was the issue! :slightly_smiling_face:

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