I am making this lesson " Basic JavaScript: Local Scope and Functions" and I put this code (in attachment), but I cant get success. Can you help?
Your code so far
function myLocalScope() {
var myVar;
console.log(myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.
Hi @alysson.campos96.
Welcome to FCC. You are supposed to follow the instructions. Simply add your code without removing what is there.
function myLocalScope() {
// Only change code below this line
var myVar
console.log('inside myLocalScope', myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);