* fix: restructure certifications guide articles * fix: added 3 dashes line before prob expl * fix: added 3 dashes line before hints * fix: added 3 dashes line before solutions
571 B
571 B
title
title |
---|
Local Scope and Functions |
Local Scope and Functions
Problem Explanation
Local scope means that the variable is available within a certain area. In the case of this exercise, myVar
is only available within the function, and not anywhere outside.
Solutions
Solution 1 (Click to Show/Hide)
function myLocalScope() {
var myVar;
console.log(myVar);
}
myLocalScope();
Code Explanation
- The variable only exists in the function. Outside the function, it is non-existent.