Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "missing = in const declaration" occurs when a const declaration was not given a value in the same statement (like const RED_FLAG;). You need to provide one (const RED_FLAG = true).

Reference entryJavaScriptFetched
SyntaxError: Missing initializer in const declaration (V8-based)
As listed by MDN Web Docs
SyntaxError: missing = in const declaration (Firefox)
As listed by MDN Web Docs
SyntaxError: Unexpected token ';'. const declared variable 'x' must have an initializer. (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.