# throw

* [JS](https://lochiwei.gitbook.io/web/js) ⟩ [statement](https://lochiwei.gitbook.io/web/js/grammar/statement) ⟩ [control flow](https://lochiwei.gitbook.io/web/js/grammar/statement/flow) ⟩ [jump](https://lochiwei.gitbook.io/web/js/grammar/statement/flow/jump) ⟩ throw
* [JS](https://lochiwei.gitbook.io/web/js) ⟩ [error](https://lochiwei.gitbook.io/web/js/err) ⟩ [handling](https://lochiwei.gitbook.io/web/js/debug/handling) ⟩ throw&#x20;

{% hint style="success" %}
([statement](https://lochiwei.gitbook.io/web/js/grammar/statement "mention"))&#x20;

<mark style="color:yellow;">**exceptions**</mark> are <mark style="color:yellow;">**thrown**</mark>&#x20;

* whenever a [<mark style="color:red;">**runtime error**</mark>](https://lochiwei.gitbook.io/web/js/err/runtime) <mark style="color:yellow;">**occurs**</mark>&#x20;
* and whenever the program <mark style="color:red;">**explicitly**</mark> <mark style="color:yellow;">**throws**</mark> one using the <mark style="color:purple;">**throw**</mark> <mark style="color:yellow;">**statement**</mark>.&#x20;

<mark style="color:yellow;">**exceptions**</mark> are <mark style="color:yellow;">**caught with**</mark> [try-catch-finally](https://lochiwei.gitbook.io/web/js/debug/handling/try-catch-finally "mention") <mark style="color:yellow;">**statement**</mark>.

```javascript
throw <expr>
```

{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}

* [](https://lochiwei.gitbook.io/web/js/debug/handling "mention")
* [try-catch-finally](https://lochiwei.gitbook.io/web/js/debug/handling/try-catch-finally "mention")
  {% endtab %}

{% tab title="📗 參考" %}

* [javascript-the-definitive-guide](https://lochiwei.gitbook.io/web/master/ref/javascript-the-definitive-guide "mention") ⟩ 5.5.6 throw
  {% endtab %}

{% tab title="📘 手冊" %}

* [throw](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw)
  {% endtab %}
  {% endtabs %}
