strict
mode against recommended approach JS-0118 16 t.jQuery,
17 );
18})(this, function (t, e) {
19 "use strict"; 20 function n(t) {
21 return t && typeof t == "object" && "default" in t ? t : { default: t };
22 }
A strict mode directive is a "use strict"
literal at the beginning of a script or function body. It enables strict mode semantics.
When a directive occurs in global scope, strict mode applies to the entire script:
"use strict";
// strict mode
function foo() {
// strict mode
}
When a directive occurs at the beginning of a function body, strict mode applies only to that function, including all contained functions:
function foo() {
"use strict";
// strict mode
}
function foo2() {
// not strict mode
};
(function() {
"use strict";
function bar() {
// strict mode
}
}());
In the CommonJS module system, a hidden function wraps each module and limits the scope of a "global" strict mode directive.
In ECMAScript modules, which always have strict mode semantics, the directives are unnecessary.
function foo() {
}
function foo() {
"use strict";
}
"use strict";
function foo() {
"use strict";
}
function foo() {
}