Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "parameter after rest parameter" occurs when a rest parameter is followed by anything else in a parameter list, including another rest parameter, a formal parameter, or a trailing comma.

Reference entryJavaScriptFetched
SyntaxError: Rest parameter must be last formal parameter (V8-based)
As listed by MDN Web Docs
SyntaxError: parameter after rest parameter (Firefox)
As listed by MDN Web Docs
SyntaxError: Unexpected token ','. Rest parameter should be the last parameter in a function 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.