Besides use strict
, which other use
directives are there?
Some more examples that can be in the “directive prologue” (a section potentially usable by JavaScript engines):
'use strict';
'use asm';
'use stricter';
'use stricter+types';
'use babel';
'use 6to5';
)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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With