freeCodeCamp Challenge Guide: Quoting Strings with Single Quotes

freeCodeCamp Challenge Guide: Quoting Strings with Single Quotes


String values in JavaScript may be written with single or double quotes, so long as you start and end with the same type of quote. Unlike some languages, single and double quotes are functionally identical in JavaScript.

"This string has \"double quotes\" in it"

The value in using one or the other has to do with the need to escape quotes of the same type. If you have a string with many double quotes, this can be difficult to read and write. Instead, use single quotes:

'This string has "double quotes" in it. And "probably" lots of them.'


but this is way different from it this one is asking about to correct the website


I’m not sure you’re able to complete the challenge as is.

var myStr = "<a href=\"\" target=\"_blank\">Link</a>";

Correct Solution:
var myStr = "<a href='' target='_blank'>Link</a>";

This condition is not fulfillable:

You should have two single quotes ’ and four double quotes "


it still didn’t work I just got the first one right


var myStr = “Link”;
This is not working for me :frowning:


var myStr = '<a href="" target="_blank">Link</a>';

This is my code. And it is correct.


Thanks, that clarified my general misunderstanding with that section.


thank you it worked.