JavaScript Strict mode For functions

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


Strict mode can also be applied to single functions by prepending the "use strict"; statement at the beginning of the function declaration.

function strict() {
   "use strict";
   // strict mode now applies to the rest of this function
   var innerFunction = function () {
     // strict mode also applies here

function notStrict() {
  // but not here

Strict mode will also apply to any inner scoped functions.

Got any JavaScript Question?