Programming FundamentalsBeginner
Scope
PronunciationSKOHP
Definition
The part of the code where a variable can be seen and used. A variable declared inside a function is usually invisible outside it.
Where you hear it
Debugging "x is not defined" errors and explaining how closures work.
Examples
The variable is out of scope after the loop ends.
Keep the scope as small as possible.
Common mistake
Confusing it with "scope" in project management (scope creep). Same word, different meaning: context decides.
Keep exploring
More in Programming Fundamentals