---
description: 🚧 under construction
---

# throw

* [JS](../..) ⟩ [statement](../../grammar/statement) ⟩ [control flow](../../grammar/statement/flow) ⟩ [jump](../../grammar/statement/flow/jump) ⟩ throw
* [JS](../..) ⟩ [error](../../err) ⟩ [handling]() ⟩ throw&#x20;

{% hint style="success" %}
([statement](../../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>](../../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](try-catch-finally "mention") <mark style="color:yellow;">**statement**</mark>.

```javascript
throw <expr>
```
{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}
* [](<> "mention")
* [try-catch-finally](try-catch-finally "mention")
{% endtab %}

{% tab title="📗 參考" %}
* [javascript-the-definitive-guide](../../../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 %}
