'use strict' console messages incorrect

wondering why when I comment out ‘use strict’ in the myLocalScope function as below,
I still see in the console the message Reference Error: assignment to undeclared variable myVar.

function myLocalScope() {
  //'use strict';

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

I expected myVar to be global (like in the previous lesson), and so in the console I should see two messages:
inside myLocalScope 3
outside myLocalScope 3


The freeCodeCamp editor uses 'use strict' automatically in the background already.

1 Like