---
description: variable / function can't be deleted❗️
---

# can't delete variable/function❗️

[JS](..) ⟩ [variable]() ⟩ variable / function can't be deleted:exclamation:

{% hint style="warning" %}
<mark style="color:red;">**Ｑ**</mark>：Can we [delete](../val/obj/prop/create/delete "mention") a [](<> "mention"):question:

<mark style="color:green;">**Ａ**</mark>：<mark style="color:red;">**No**</mark>:exclamation:

* [sloppy-mode](../concept/env/js-engine/mode/sloppy-mode "mention")：deletion <mark style="color:red;">**fails**</mark>**&#x20;**<mark style="color:yellow;">**silently**</mark>.
* [strict-mode](../concept/env/js-engine/mode/strict-mode "mention")：:no\_entry: [<mark style="color:red;">**SyntaxError**</mark>](../err/syntax/delete-of-an-unqualified-identifier-in-strict-mode).
{% endhint %}

{% tabs %}
{% tab title="👥 相關" %}
* [delete](../val/obj/prop/create/delete "mention") - delete an object's [prop](../val/obj/prop "mention").
* :no\_entry:[delete-of-an-unqualified-identifier-in-strict-mode](../err/syntax/delete-of-an-unqualified-identifier-in-strict-mode "mention")
{% endtab %}

{% tab title="🗣 討論" %}
* [How can I unset a JavaScript variable?](https://stackoverflow.com/questions/1596782/how-can-i-unset-a-javascript-variable)
{% endtab %}

{% tab title="📘 手冊" %}
* [delete operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete)
{% endtab %}
{% endtabs %}
