# JavaScript Overview – Strict Mode

Strict mode of ECMAScript5 executes strict code using the “use strict” directive. This implements a restricted subset of the language which fixes a few deficiencies and provides stronger error checking and increased security.

Follow the following guidelines to implement strict mode:

- Begin the script with "use strict";.

- All variables must be declared with var.

  In non-strict mode, assigning an undeclared variable adds it to the global object while strict mode will throw an error and prevents accidentally creating a global variable.

- The with statement is not allowed.

- For function invocations (not methods) this === undefined.

  In non-strict code, this === invokes the global object.

Note: For more information on Strict Mode visit the w3school website topic JavaScript Use Strict (internet access required.)