Somebody Please Help Me Im Stuck In This Challenge For 5 Days

I Need Help this is my code so far

function myLocalScope() {
var myVar = 5;
console.log(myVar);
}
myLocalScope();
console.log('inside myLocalScope', myVar);

Please Help!

link to challenge:
Click This.

Don’t assign anything to the variable, just declare it.

2 Likes

You did it right, but keep the "console.log(‘inside myLocalScope’, myVar) " as it is to be able to console.log function myLocalScope().

function myLocalScope() {

‘use strict’;

// Only change code below this line

var myVar = 5;

console.log(‘inside myLocalScope’, myVar);

}

myLocalScope();

// Run and check the console

// myVar is not defined outside of myLocalScope

console.log(‘outside myLocalScope’, myVar);

1 Like