I declare myVar inside of myLocalScope function and it is still accessible from outside the function. The test checks correct. Should it?
Your code so far
function myLocalScope() {
'use strict'; // you shouldn't need to edit this line
var myVar =5;
console.log(myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log(myVar);
// Now remove the console log line to pass the test
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36
.
Challenge: Local Scope and Functions
Link to the challenge: