Function scoping in strict mode

suggest change

In Strict Mode, functions declared in a local block are inaccessible outside the block.

"use strict";
{
  f(); // 'hi'
  function f() {console.log('hi');}
}
f(); // ReferenceError: f is not defined

Scope-wise, function declarations in Strict Mode have the same kind of binding as let or const.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents