Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "getter functions must have no arguments" occurs when a getter is declared and the parameter list is non-empty.

Reference entryJavaScriptFetched
SyntaxError: Getter must not have any formal parameters. (V8-based)
As listed by MDN Web Docs
SyntaxError: getter functions must have no arguments (Firefox)
As listed by MDN Web Docs
SyntaxError: Unexpected identifier 'x'. getter functions must have no 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.