I’m facing some difficulties while trying to add a local variable to a function.
Would some caritative soul lend me a hand to get this test passing?
Your code so far
function myLocalScope() {
'use strict';
// Only change code below this line
var myVar = "Hello";
console.log('inside myLocalScope', myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);
The console will display an error but that is intended. Your code passes when i try submitting it. However if yours isn’t passing, try submitting using another browser.