Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception ""use strict" not allowed in function" occurs when a "use strict" directive is used at the top of a function with default parameters, rest parameters, or destructuring parameters.

Reference entryJavaScriptFetched
SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (V8-based)
As listed by MDN Web Docs
SyntaxError: "use strict" not allowed in function with default parameter (Firefox)
As listed by MDN Web Docs
SyntaxError: "use strict" not allowed in function with rest parameter (Firefox)
As listed by MDN Web Docs
SyntaxError: "use strict" not allowed in function with destructuring parameter (Firefox)
As listed by MDN Web Docs
SyntaxError: 'use strict' directive not allowed inside a function with a non-simple parameter list. (Safari)
As listed by MDN Web Docs
Category
SyntaxError
Severity
error
Runtime
both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: MDN Web Docs. Data fetched 2026-09-25T01:48:37.274Z.