You should add a local myVar variable. Will not pass test

Tell us what’s happening:
The second test “You should add a local myVar variable” will not pass.

I have run the code with console.log('outside myLocalScope', myVar); commented out also.

Your code so far


function myLocalScope() {
'use strict';

// Only change code below this line
var myVar;
console.log('inside myLocalScope', myVar);
}
myLocalScope();

// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0.

Challenge: Local Scope and Functions

Link to the challenge:

You need to assign a value to the variable. If that doesn’t work , you can try it on a different browser

I’ve seen a couple of folks having issues with this challenge on firefox, fwiw.

Yeah, yesterday there were 3 people having a problem with this challenge on Firefox

That’s likely the issue. I changed that challenge to use a regex flag that Firefox can’t cope with, sorry about that!

The fix is on the way, but until that lands another browser should work. @duopica I’ve personally checked it with Chrome, so I recommend switching to that if you can.

Gotta love that browser compatibility stuff. Thanks for the update!

Yep, always fun. At some point we hope to catch these kinds of things automatically during testing, but we’re not quite there yet.

Anyway, that fix has been merged and so it won’t be long before it’s live.

1 Like