Cant pass test, code wrong?

Tell us what’s happening:

Cant pass test

  **Your code so far**
  function myLocalScope() {

var myVar = 5;
console.log(myVar);
}
myLocalScope();


function myLocalScope() {
var myVar = 5;  
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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36.

Challenge: Local Scope and Functions

Link to the challenge:

You’ve changed the code. Reset the lesson. The requirement is for you to just declare variable myVar inside the function.

wow all that for that…

Thank you

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