Skip to content
JS
JavaScript error

ReferenceError

The JavaScript strict mode-only exception "Assignment to undeclared variable" occurs when the value has been assigned to an undeclared variable.

Reference entryJavaScriptFetched
ReferenceError: x is not defined (V8-based)
As listed by MDN Web Docs
ReferenceError: assignment to undeclared variable x (Firefox)
As listed by MDN Web Docs
ReferenceError: Can't find variable: x (Safari)
As listed by MDN Web Docs
Category
ReferenceError in strict mode only
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.