Standard built-ins
SyntaxError()
Indicates invalid syntax or failed parsing in relevant operations. Creating it does not throw automatically.
Formal Syntax & Structure
javascript syntaxjavascript
new SyntaxError([message], [options])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| message | String | Diagnostic text. |
| options | Object | Optional cause property. |
Return Value
SyntaxError
Error subtype instance.
Working Example
Example Snippetjavascript
console.log(new SyntaxError("example").name);