liveBook · Manning

Strict mode

Strict mode is a JavaScript execution mode that applies stricter parsing and runtime rules and restricts or reports certain error-prone behaviors.

How 2 Manning books explain it

Secrets of the JavaScript Ninja, Second Edition

A JavaScript mode that applies stricter parsing and runtime semantics.

How it is used
Uses strict mode to prevent arguments-object changes from aliasing matching function parameters.
How deep it goes
Defines strict mode as an ES5 behavior change and demonstrates detached arguments, while deferring other changed or banned features.
Examples
Compares parameter and arguments mutations using a gardener parameter and the value "ninja".
What you can do after
Apply strict mode with a "use strict" directive to keep arguments-object mutations from changing matching parameters.

Read how Secrets of the JavaScript Ninja, Second Edition explains strict mode →

Secrets of the JavaScript Ninja, Third Edition

A JavaScript execution mode that applies stricter syntax and runtime semantics.

How it is used
Clarifies how standalone function calls determine `this` and why strict behavior avoids silent global-object mistakes.
How deep it goes
Explains the standalone-call `this` behavior and its rationale but defers strict mode's other details.
Examples
Uses standalone calls and TypeScript compiler output containing `use strict` to illustrate the behavior and directive.
What you can do after
Understand how strict mode affects `this` in standalone calls and when binding supplies a different context.

Read how Secrets of the JavaScript Ninja, Third Edition explains strict mode →

Also covered in

What to know first

Related concepts

Questions about strict mode

What is strict mode?

Strict mode is a JavaScript execution mode that applies stricter parsing and runtime rules and restricts or reports certain error-prone behaviors.

Which Manning books explain strict mode?

Secrets of the JavaScript Ninja, Second Edition and Secrets of the JavaScript Ninja, Third Edition.

What should I know before learning strict mode?

Manning books that teach strict mode usually introduce JavaScript first.

What is the difference between strict mode and arguments aliasing?

Strict mode is a JavaScript execution mode that applies stricter parsing and runtime rules and restricts or reports certain error-prone behaviors. The non-strict-mode behavior in which indexed values of the arguments object and corresponding function parameters share changes.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.