Already I have added local variable yet it is showing the error to add the local variable

Tell us what’s happening:
Already I have added local variable yet it is showing the error to add the local variable
Your code so far


function myLocalScope() {
var myVar = 5;
console.log(myVar);
}
myLocalScope();
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36.

Challenge: Local Scope and Functions

Link to the challenge:

Your code is mostly fine, but you got rid of a comment the code expects to be there causing it to fail

function myLocalScope() {

  // Only change code below this line
var myVar = 5;
console.log(myVar);
}
myLocalScope();

Test can be very pedantic, so make sure to closely follow the instructions

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