Local Scope and Functions issue with commented code.
See original GitHub issueChallenge Local Scope and Functions has an issue.
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function myLocalScope(myVar) {
myVar = 5;
console.log(myVar);
}
//var myVar = 300;
// LINE 7 IS WHAT I AM TALKING ABOUT.. IF I COMMENT IT, I SUCCESFUL FINISH THE CHALLENGE.. BUT IF I DELETE LINE 7, IT DOESN'T WORK... and if I UnComment it, so it doesn't work too.. That's a bug
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
// Now remove the console log line to pass the test
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
CodeChallenge/Local Scope and Functions.md at master
Variables which are declared within a function , as well as the function parameters have local scope . That means, they are only...
Read more >Local Scope and Functions - Guide
Problem Explanation. Local scope means that the variable is available within a certain area. In the case of this exercise, myVar is only ......
Read more >Local Scope and Functions, freeCodeCamp Basic Javascript
In this challenge we learn about local scope and how variables in javascript that are declared inside of a function only exist in...
Read more >Local Scope and Functions - Free Code Camp - YouTube
In this tutorial we go over another basic JavaScript lesson from FreeCodeCamp's basic computer programming course. Scope relates to where ...
Read more >Global vs Local Scope in Functions - Free Code Camp
An experienced programmer goes over the global vs local scope in functions lesson which makes up a part of the FreeCodeCamp curriculum.
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
@systimotic Great detective work here, and thanks for resurrecting this old (but unresolved) issue.
Yes - I agree with your potential solution. Could you create a PR for this?
Regarding removing commented code before processing, this sounds like it would be a good long-term solution for this kind of situation, but would involve changes to the platform itself. So I’ll CC @BerkeleyTrue on this.
I’m closing this issue as stale since it hasn’t been active lately. If you think this is still relevant to the newly updated platform, please explain why, then reopen it.