---
description: '"var" has a lot of problems, don''t use it.'
---

# stop using var❗️

[JS](../../..) ⟩ [variable](../..) ⟩ [var]() ⟩ stop using var:exclamation:

{% hint style="warning" %}
* [var-is-a-statement](var-is-a-statement "mention")(<mark style="color:orange;">**side effects**</mark>)
* [is-global-obj-prop](is-global-obj-prop "mention")(<mark style="color:orange;">**side effect**</mark>)
* [accessing-var-before-declaration-gets-undefined](accessing-var-before-declaration-gets-undefined "mention")(<mark style="color:red;">**unexpected result**</mark>)
* [in-block-cant-shadow](in-block-cant-shadow "mention") (<mark style="color:red;">**unexpected result**</mark>)
* [var-in-block-cant-shadow-outer-let](var-in-block-cant-shadow-outer-let "mention")(<mark style="color:red;">**unexpected result**</mark>)
* [param-by-var](param-by-var "mention")(<mark style="color:yellow;">**bad practice**</mark>)
* [redeclare](redeclare "mention")(<mark style="color:yellow;">**bad practice**</mark>)
{% endhint %}

{% tabs %}
{% tab title="👥 相關" %}
* [statement-expected](../../../grammar/statement/statement-expected "mention"):exclamation:
* :white\_check\_mark: [always](../../../concept/env/js-engine/mode/strict-mode/always "mention")
{% endtab %}

{% tab title="📘 手冊" %}
* [ ] [Statements and declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements) ⟩ [declaring variables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements#declaring_variables) ⟩ [var](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var)
* [ ] [Difference between statements and declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements#difference_between_statements_and_declarations) ⭐️⭐️⭐️ ❗️❗️❗️
{% endtab %}
{% endtabs %}
