javascriptstrictusing-directivesuse-strict

Javascript: besides "use strict", which other "use" directives are there?


Besides use strict, which other use directives are there?


Solution

  • Some more examples that can be in the “directive prologue” (a section potentially usable by JavaScript engines):

    A tweet by Jeremy Ashkenas suggests some further use of + and - prefixes in the same 'use ...'; string ('use stricter +types -tco +jsx +asm +es2019-pre';), but that seems to contradict the spec (further clarified in kangax's answer and Bergi's answer).