Tell us what’s happening:
Hi
Can this part seems to catch of set quite a few. Why do we have a variable that cannot be defined outside of a function for?
Your code so far
function myLocalScope() {
// Only change code below this line
var myVar = "Help"
console.log('inside myLocalScope', myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.56
.
Challenge: Local Scope and Functions
Link to the challenge: