Generates an error condition that can be handled by a try…catch…finally statement.
Syntaxthrow exception
Examples
The following example throws an error inside a try block, and it is caught in the catch block.
try {
throw new Error(200, "x equals zero");
}
catch (e) {
document.write(e.message);
}
// Output: x equals zero.
Remarks
The required exception argument can be any expression.
See also Other articles AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4