Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "rest parameter may not have a default" occurs when a rest parameter has a default value. Because the rest parameter always creates an array, the default value would never apply.

Reference entryJavaScriptFetched
SyntaxError: Rest parameter may not have a default initializer (V8-based)
As listed by MDN Web Docs
SyntaxError: rest parameter may not have a default (Firefox)
As listed by MDN Web Docs
SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (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.