> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/grammar/token/punctuator/parentheses.md).

# parentheses ()

[JS](/web/js.md) ⟩ [grammar](/web/js/grammar.md) ⟩ [token](/web/js/grammar/token.md) ⟩ [punctuator](/web/js/grammar/token/punctuator.md) ⟩ parentheses ()

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

* [invocation expression：f()](/web/js/grammar/statement/expr/invoke.md)： <mark style="color:blue;">**`f(args)`**</mark>&#x20;
* [optional invocation ?.()](/web/js/val/obj/prop/access/optional-invocation-..md)：<mark style="color:blue;">**`?.()`**</mark>&#x20;
* [for loops](/web/js/grammar/statement/loop/for.md)： [<mark style="color:blue;">`for(;;)`</mark>](/web/js/grammar/statement/loop/for/for.md), [<mark style="color:blue;">`for(in)`</mark>](/web/js/grammar/statement/loop/for/in.md), [<mark style="color:blue;">`for(of)`</mark>](/web/js/grammar/statement/loop/for/of.md)&#x20;
* [switch](/web/js/grammar/statement/flow/branch/switch.md) - <mark style="color:blue;">`switch(<expr>){...}`</mark>.
* [try-catch-finally](/web/js/debug/handling/try-catch-finally.md) - <mark style="color:blue;">`try {...} catch(err) {...}`</mark>.
  {% endtab %}

{% tab title="⭐️ 重點" %}
:point\_right: [table of operators](/web/js/grammar/op/table-of-operators.md)

{% hint style="warning" %}
[nullish coalescing (??)](/web/js/grammar/op/logical/nullish-coalescing.md)

* <mark style="color:yellow;">**precedence**</mark> of <mark style="color:purple;">**`??`**</mark> <mark style="color:yellow;">**relative to**</mark><mark style="color:yellow;">**&#x20;**</mark><mark style="color:yellow;"><mark style="color:blue;">**`||`**<mark style="color:blue;"></mark><mark style="color:yellow;">**,**</mark><mark style="color:yellow;">**&#x20;**</mark><mark style="color:yellow;"><mark style="color:blue;">**`&&`**<mark style="color:blue;"></mark> <mark style="color:red;">**not**</mark>**&#x20;**<mark style="color:yellow;">**defined**</mark>.
* <mark style="color:red;">**explicitly**</mark> <mark style="color:yellow;">**use**</mark> <mark style="color:purple;">**parentheses**</mark> <mark style="color:red;">**if**</mark> <mark style="color:purple;">**`??`**</mark>**&#x20;is&#x20;**<mark style="color:yellow;">**mixed**</mark>**&#x20;with&#x20;**<mark style="color:yellow;"><mark style="color:blue;">**`||`**<mark style="color:blue;"></mark><mark style="color:yellow;">**,**</mark><mark style="color:yellow;">**&#x20;**</mark><mark style="color:yellow;"><mark style="color:blue;">**`&&`**<mark style="color:blue;"></mark>**.**
  {% endhint %}

{% hint style="warning" %}
[exponentiation (\*\*)](/web/js/grammar/op/arithmetic/binary/exp.md)

* <mark style="color:yellow;">**precedence**</mark> of <mark style="color:purple;">**`**`**</mark>  <mark style="color:red;">**relative**</mark>**&#x20;**<mark style="color:yellow;">**to**</mark>**&#x20;**<mark style="color:blue;">**`-`**</mark>**&#x20;(**<mark style="color:orange;">**unary negation**</mark>**)** <mark style="color:red;">**not**</mark>**&#x20;**<mark style="color:yellow;">**defined.**</mark>
* <mark style="color:red;">**explicitly**</mark>**&#x20;**<mark style="color:yellow;">**use**</mark> <mark style="color:purple;">**parentheses**</mark>**&#x20;when mixing&#x20;**<mark style="color:blue;">**`-`**</mark>**&#x20;with&#x20;**<mark style="color:purple;">**`**`**</mark>**.**
  {% endhint %}
  {% endtab %}
  {% endtabs %}
