For functions

Download javascript eBook


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.


Contributors: 3
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial:

Download eBook