Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "duplicate formal argument x" or "duplicate argument names not allowed in this context" occurs when a function creates two or more parameter with the same name, and the function is not a non-strict function with only simple parameters.

Reference entryJavaScriptFetched
SyntaxError: Duplicate parameter name not allowed in this context (V8-based)
As listed by MDN Web Docs
SyntaxError: duplicate formal argument x (Firefox)
As listed by MDN Web Docs
SyntaxError: duplicate argument names not allowed in this context (Firefox)
As listed by MDN Web Docs
SyntaxError: Cannot declare a parameter named 'x' in strict mode as it has already been declared. (Safari)
As listed by MDN Web Docs
SyntaxError: Duplicate parameter 'x' not allowed in function with default parameter values. (Safari)
As listed by MDN Web Docs
SyntaxError: Duplicate parameter 'x' not allowed in function with a rest parameter. (Safari)
As listed by MDN Web Docs
SyntaxError: Duplicate parameter 'x' not allowed in function with destructuring parameters. (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.273Z.