freeCodeCamp: bug @ escape sequence or issue with instructions or both

Challenge Escape Sequences in Strings has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


var myStr = "FirstLine\n\\SecondLine\\\r\nThirdLine"; // Change this line



The code I have written above satisfies the requested output, but does not display correctly and is judged incorrectly in the codechecker in the lesson. I have tested it on other platforms, and it ouputs exactly as requested. BTW, the instructions:

Here is the text with the escape sequences written out.

“FirstLinenewlinebackslashSecondLinebackslashcarriage-returnThirdLine”

are also misleading because that implies \n is not needed before the carriage-return and results in line three overwriting line two.

Why does my code work on a standard platform, but not here?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

@systimotic Sorry so long in getting back on here. I’d be glad to create an article! I’ll look at the wiki and either post on the forum or here with the draft as you mentioned. Might take me a bit, but I’ll get it done as soon as possible.

We recently made some changes to this challenge in the beta, as there were a lot of problems like this. First, we changed the sequence to something without \r\n, because as you noted, it acts weird. Then we changed the tests to test each part more specifically, hoping to reduce the amount of people confused by typo’s they made.

You can check out the updated challenge on the beta site. @raisedadead @hathcode Could you please take a look at the new version, and see if it resolves this issue?