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