Standard built-ins
ReferenceError()
Indicates an unresolvable reference or access to an uninitialized binding. Creating it does not throw automatically.
Formal Syntax & Structure
javascript syntaxjavascript
new ReferenceError([message], [options])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| message | String | Diagnostic text. |
| options | Object | Optional cause property. |
Return Value
ReferenceError
Error subtype instance.
Working Example
Example Snippetjavascript
console.log(new ReferenceError("example").name);