Strict Mode

JavaScript’s strict mode is a way to opt-in to a restricted variant of JavaScript, thereby implicitly opting out of “sloppy mode”. Strict mode isn’t just a subset: it intentionally has different semantics from regular code. Browsers not supporting strict mode will run strict mode code with different behavior from browsers that do, so don’t rely on strict mode without feature-testing for support for the relevant aspects of strict mode. Strict mode code and non-strict mode code can coexist so that scripts can opt into strict mode incrementally.

Strict mode makes several changes to normal JavaScript semantics:

Visit the following resources to learn more: