Basic JavaScript - Local Scope and Functions

Tell us what’s happening:
The system still won’t let me pass the tests. I’ve deleted the console.log and added a: varMyVar variable

Your code so far

function myLocalScope() {
var MyVar = 5;
// Only change code below this line

}
myLocalScope();

function myLocalScope() {
var MyVar = 5;
  // Only change code below this line
  
}
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_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Local Scope and Functions

Link to the challenge:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.