JavaScript Strict mode

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


  • 'use strict';
  • "use strict";
  • `use strict`;


Strict mode is an option added in ECMAScript 5 to enable a few backwards-incompatible enhancements. Behaviour changes in "strict mode" code include:

  • Assigning to undefined variables raises an error instead of defining new global variables;
  • Assigning to or deleting non-writable properties (such as window.undefined) raises an error instead of executing silently;
  • Legacy octal syntax (ex. 0777) is unsupported;
  • The with statement is unsupported;
  • eval cannot create variables in the surrounding scope;
  • Functions' .caller and .arguments properties are unsupported;
  • A function's parameter list cannot have duplicates;
  • window is no longer automatically used as the value of this.

NOTE:- 'strict' mode is NOT enabled by default as if a page uses JavaScript which depends on features of non - strict mode, then that code will break. Thus, it has to be turned on by the programmer himself / herself.

Got any JavaScript Question?