Back to Content

Strict mode

files/en-us/glossary/strict_mode/index.md

latest516 B
Original Source

JavaScript's strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "{{Glossary("Sloppy_mode", "sloppy mode")}}". Strict mode isn't just a subset: it intentionally has different semantics from normal code.

Strict mode for an entire script is invoked by including the statement "use strict"; before any other statements.

See also

  • Strict mode
  • Related glossary terms:
    • {{Glossary("Sloppy mode")}}