Comments are not ignored?
See original GitHub issueChallenge Comparisons with the Logical And Operator has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function testLogicalAnd(val) {
// Only change code below this line
if (val<=50 && val>=25) {
return "Yes";
//
}
// Only change code above this line
return "No";
}
// Change this value to test
testLogicalAnd(10);
I commented out the second if statement and did not pass, this test failed ‘You should only have one if statement’
function testLogicalAnd(val) {
// Only change code below this line
if (val<=50 && val>=25) {
// if (val) {
return "Yes";
// }
}
// Only change code above this line
return "No";
}
// Change this value to test
testLogicalAnd(10);
Removing the if statement all together passed the test:
function testLogicalAnd(val) {
// Only change code below this line
if (val<=50 && val>=25) {
return "Yes";
}
// Only change code above this line
return "No";
}
// Change this value to test
testLogicalAnd(10);
Not sure if this is intended behavior but it felt like a bug, commenting out the second if statement would work under normal circumstances. Thanks.
(Bouncey edited for code formatting)
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (13 by maintainers)
Top Results From Across the Web
Comment: the interpreter is not ignoring comments
I commented out the line with the .push method with a "#", but the interpreter still saw the old code and said my...
Read more >How to fix HTML file comments not being ignored by Webpack ...
7.1), since Webpack Dev Server doesn't seem to ignore comments in source HTML files. It tries to require resources from commented sections of ......
Read more >eslint-disable ... comments are not ignored anymore by line ...
What actually happened? Please include the actual, raw output from ESLint. I get an error "3:22 error Expected comment to be above code...
Read more >Comment lines in commit-messages are not ignored
I have a commit template which is inserted automagically in version 2059. I like that, thank you! However, my template includes lines ...
Read more >C++ Comments - W3Schools
Any text between // and the end of the line is ignored by the compiler (will not be executed). This example uses a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Although this is the oldest, closing in favor of https://github.com/freeCodeCamp/freeCodeCamp/issues/11360 which has more relevant technical discussion.
Ah, sorry I meant to close this in favor of https://github.com/freeCodeCamp/freeCodeCamp/issues/15134