In JavaScript, ES modules (files imported using import / export) have special semantics:
All code inside a module is automatically executed in strict mode .
This is specified by the ECMAScript standard and does not require the explicit " use strict " ; directive.
Effects:
You do not need to write " use strict " ; at the top of a module file.
You cannot turn strict mode off for module code.
All module top-level code is treated as strict.
Now evaluate each option:
Option A:
Add the statement use non-strict; before any other statements in the module to enable notstrict mode.
There is no use non-strict; directive in JavaScript.
The only directive recognized by engines is " use strict " ;.
You cannot explicitly enable a “non-strict” mode with such a string.
Option B:
Imported modules are in strict mode whether you declare them as such or not.
This matches the language specification.
ES modules are always in strict mode, automatically.
This is true.
Option C:
Add the statement use strict = false; before any other statements in the module to enable notstrict mode.
use strict = false; is not a directive; it is parsed as a normal expression, and does not affect strict mode.
There is no supported way to disable strict mode in modules.
Option D:
A developer can only reference notStrict() functions from the imported module.
There is no special notStrict() restriction in modules.
Functions exported/imported in modules are simply subject to strict mode rules like the rest of the module’s code.
Therefore, the only correct statement is:
Answer: B
Study Guide / Concept References (no links):
ES modules (import / export)
Automatic strict mode in modules
" use strict " ; directive for scripts vs modules
Inability to disable strict mode in ES module code