Non-Simple parameter lists

suggest change
function a(x = 5) {
  "use strict";
}

is a SyntaxError. A function whose parameter list is not simple cannot contain a "use strict" directive. The list above is not simple because of the default value x = 5. The same parameters are valid without that directive.

Non-Simple parameters include -

function a(x = 1) {
  "use strict";
}
function a({ x }) {
  "use strict";
}
function a(...args) {
  "use strict";
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents