Adding a comment causes a valid answer to be wrong
See original GitHub issueAffected page
Adding a comment causes the result that should be correct to be returned as invalid in the following page:
JavaScript Algorithms and Data Structures > ES6 > Compare Scopes of the var and let Keywords
Your code
Code used:
function checkScope() {
let i = 'function scope';
if (true) {
/* Block scope */
let i = 'block scope';
console.log('Block scope i is: ', i);
}
console.log('Function scope i is: ', i);
return i;
}
Console result after running tests:
// running tests
The variable i declared in the if statement should equal the string block scope.
// tests completed
// console output
Block scope i is: block scope
Function scope i is: function scope
Expected behavior
The answer above should be taken as correct ✅
Screenshots
System
- Device: Desktop
- OS: Windows 10
- Browser: Brave
- Version: 1.29.81 Chromium: 93.0.4577.82 (Build oficial) (64 bits)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Is it in bad form to answer a question with another user's ...
Yes, I think it would be. You would be receiving any rep for it at that point instead of the person who made...
Read more >Questioning Strategies
Handling student responses to questions · Redirect: When a student responds to a question, the instructor can ask another student to comment on...
Read more >Student: Answering Questions - Top Hat Support
Your professor may have chosen to not set a correct answer for some or all of the questions they have created. If this...
Read more >Post & interact with comments - Computer - YouTube Help
YouTube Comments: Replying, filtering, & moderating If a video's owner has turned on comments, you can post comments and like, dislike, or rep....
Read more >Avoid Bad Survey Questions: Loaded Question, Leading ...
Learn more about bad survey questions, loaded questions, leading questions, and mistakes to avoid if you want to write good surveys.
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
Hi,
Would I be able to have a go at this?
Thanks
Thanks for the report @jsgm. The problem is that comments are not removed from
(getUserInput('index'))
, only from thecode
variable.A simple fix would be to re-write the test to use
code
. For example: