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.