Standard built-ins
Error()
Creates an Error object; it does not itself throw. Options can supply cause.
Formal Syntax & Structure
javascript syntaxjavascript
new Error([message], [options])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| message | String | Diagnostic message. |
| options | Object | Optional cause property. |
Return Value
Error
Error instance.
Working Example
Example Snippetjavascript
console.log(new Error("bad").message);