Describe your problem and how to reproduce it:
Running the test will fail if you have anything commented after the code.
Deleting the comment line allows us to pass the test.
The presence of a comment should not affect the output of the test.
(function() {
console.log("A cozy nest is ready");
})();
// makeNest();
Add a Link to the page with the problem:
Object Oriented Programming: Understand the Immediately Invoked Function Expression (IIFE)
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife
Tell us about your browser and operating system:
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
It looks like this is caused because the test is removing every whitespace and make the code one line, then test it with a regex, that test if the string ends with a )
parentheses. This might lead to some errors in which people comment the uneeded code.
This can be easily fixed by changing the regex string from instead of testing if it ends with a ()
it will test if it's an IIFE function. So it will ignore anything after the IIFE. I can do this.
@LazaroFilm thanks for reporting this, it's definitely not working as intended.
@JoshuaPelealu, that's my assessment, too. A PR would be very welcome.
Most helpful comment
@LazaroFilm thanks for reporting this, it's definitely not working as intended.
@JoshuaPelealu, that's my assessment, too. A PR would be very welcome.