A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/statements/throw below:

throw · WebPlatform Docs

throw Summary

Generates an error condition that can be handled by a try…catch…finally statement.

Syntax
throw 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 Attributions

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