# const can't reassign

[JS](../../..) ⟩ [statement](../../../grammar/statement) ⟩ [declaration](../../../grammar/declare) ⟩ [const]() ⟩ can't reassign

{% hint style="danger" %}
a [](<> "mention") <mark style="color:red;">**can't**</mark> be <mark style="color:yellow;">**reassigned**</mark>. ( 👉 [cant-reassign](cant-reassign "mention"):exclamation:)
{% endhint %}

{% tabs %}
{% tab title="💈範例" %}
* replit：[const can't reassign](https://replit.com/@pegasusroe/const-cant-reassign#index.js)
* 👉 [type](../../../err/type "mention") ⟩ [const-no-reassign](../../../err/type/const-no-reassign "mention")

```javascript
const name = "Frank";

name = "Suzy";            // can't reassign❗
//     ^^^^^^
// ⛔ TypeError: Assignment to constant variable.
// (it means a const doesn't have to the "ability" to do reassignment)
```
{% endtab %}

{% tab title="📗 參考" %}
* [ ] [ydkjs-scope-and-closures-v.2](../../../../master/ref/book/you-dont-know-js-series-v.2/ydkjs-scope-and-closures-v.2 "mention") ⟩ Ch. 5 ⟩ [Constants?](https://github.com/getify/You-Dont-Know-JS/blob/2nd-ed/scope-closures/ch5.md#constants)
{% endtab %}
{% endtabs %}
