question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comment your JavaScript Code passes multi-line comment tests without any code

See original GitHub issue

Challenge Name

http://beta.freecodecamp.com/en/challenges/basic-javascript/comment-your-javascript-code

Issue Description

Pressing Run tests without typing any code passes the tests:

  • Create a /* */ style comment that contains at least five letters.
  • Make sure that you close the comment with a */.

I’ve tried running in an incognito window, signed out, and in a different browser and it has the same issue.

Browser Information

  • Browser Name, Version: Chrome 55.0.2883.95 (64-bit) (also on Firefox)
  • Operating System: OSX EL Capitan
  • Mobile, Desktop, or Tablet: Desktop

Screenshot

screen shot 2017-01-22 at 10 15 33

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
petercollingridgecommented, Jan 25, 2017

The question already asks for at least 5 characters in the comment, which the extra code inserted (/*fcc*/) does not have. However the inserted code is matched by the regex /(\\/\\*)[\\w\\W]{5,}(?=\\*\\/)/ at start of the first comment to the end of the last one.

If the regex were changed to something like (\\/\\*)([^\\*\\/]{5,})(?=\\*\\/), I think that would solve the problem as it would restrict the characters in between the start and end of the comment from not ending the comment. I think the final test for ending the comment would have to be removed (it’s covered by the second test anyway).

0reactions
Shigosagcommented, Aug 8, 2021

This worked for me: /fiverr/ /*fiverr*/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clarifying Code with Javascript Comments | Udacity
Javascript multiline comments, also known as block comments, start with a forward slash followed by an asterisk (/*) and end with an asterisk ......
Read more >
JavaScript Comments - W3Schools
JavaScript comments can be used to explain JavaScript code, and to make it ... This example uses a multi-line comment (a comment block)...
Read more >
How to do multi line comment in JavaScript - Youth4work
Multiline comments are used for large text descriptions of code or to comment out chunks of code while debugging applications. Comments are ignored...
Read more >
Multi line comment Not working | Codecademy
I'm attempting the final part of section 4.4 I entered my code like this: #single line comment =begin this is a multiple line...
Read more >
Best practices for writing code comments - Stack Overflow Blog
Writing and then maintaining comments is an expense. · Your compiler doesn't check your comments so there is no way to determine that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found