Study Guide: JavaScript->Strict Mode
Strict Mode

The strict mode

Strict mode can be enabled by placing '"use strict";' at the beginning of a script, before other statements:

// Dummy comment
"use strict";
var myvar = 4;

It can also be enabled for a single function only:

function myfun{
  "use strict";
  var myvar = 6;

Strict mode ensures the following:

  • New variables need to be declared with "var"; "var" is no longer optional.
  • Attempts to write to non-writable variables throw an error rather than silently doing nothing.
  • Attempts to delete undeletable properties throw an error rather than silently doing nothing.
  • Octal numerals are disallowed.
  • Etc.

Strict mode is available since JavaScript 1.8.5, i.e. ECMAScript version 5.

External links

  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.



Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.

Manage research, learning and skills at Create an account using LinkedIn to manage and organize your omni-channel knowledge. is like a shopping cart for information -- helping you to save, discuss and share.

  Contact Us