Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "setter functions must have one argument" occurs when a setter is declared and the parameter list is not consisted of exactly one formal parameter.

Reference entryJavaScriptFetched
SyntaxError: Setter must have exactly one formal parameter. (V8-based)
As listed by MDN Web Docs
SyntaxError: Setter function argument must not be a rest parameter (V8-based)
As listed by MDN Web Docs
SyntaxError: setter functions must have one argument (Firefox)
As listed by MDN Web Docs
SyntaxError: Unexpected token ','. setter functions must have one parameter. (Safari)
As listed by MDN Web Docs
SyntaxError: Unexpected token '...'. Expected a parameter pattern or a ')' in 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.