What is wrong with the code? Basic JavaScript: Local Scope and Functions

Tell us what’s happening:
// running tests You should add a local

myVar

variable. // tests completed // console output SyntaxError: invalid regular expression flag s

Your code so far


function myLocalScope() {
'use strict';

// Only change code below this line
var myVar = 'foo';
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 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0.

Challenge: Local Scope and Functions

Link to the challenge:

I have seen this 3 times now… You can try this on a different browser. There is a bug on the tester that it might not work on Firefox.

Use this code to complete the challenge -

function myLocalScope() {
  'use strict';

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

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

Change your browser if the problem persists. use chrome.

It looks like your code is functionally identical to theirs. The problem is a Firefox issue that will be fixed soon.