DEV Community

Discussion on: What "use strict" means in JavaScript

Collapse
 
nickytonline profile image
Nick Taylor

One thing to note is that you do not need to add "use strict"; when writing a module (Common JS or ES Module) as it's strict by default.

"In the CommonJS module system, a hidden function wraps each module and limits the scope of a “global” strict mode directive.

In ECMAScript modules, which always have strict mode semantics, the directives are unnecessary." (See eslint.org/docs/rules/strict)

Collapse
 
iamismile profile image
Ismile Hossain

Thanks for sharing this.