| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Strict_non_simple_params | [Back] [Original] |
Get to know MDN better
Firefox: SyntaxError: "use strict" not allowed in function with default parameter SyntaxError: "use strict" not allowed in function with rest parameter SyntaxError: "use strict" not allowed in function with destructuring parameter Chrome: SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list
"use strict" :
ECMAScript "use strict"
sum a=1 b=2 :
function sum(a=1, b=2) {
// SyntaxError: "use strict" not allowed in function with default parameter
"use strict";
return a + b;
}
strict strict "use strict" :
"use strict";
function sum(a = 1, b = 2) {
return a + b;
}
function :
var sum = function sum([a, b]) {
// SyntaxError: "use strict" not allowed in function with destructuring parameter
"use strict";
return a + b;
};
:
var sum = (function () {
"use strict";
return function sum([a, b]) {
return a + b;
};
})();
this :
var callback = (...args) => {
// SyntaxError: "use strict" not allowed in function with rest parameter
"use strict";
return this.run(args);
};
:
var callback = (() => {
"use strict";
return (...args) => {
return this.run(args);
};
})();
| Web Proxy Viewer | New URL | Original Page |