> 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/variable/delete.md).

# can't delete variable/function❗️

variable / function can't be deleted❗️

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

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

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

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

{% tabs %}
{% tab title="👥 相關" %}

* [delete](/web/js/val/obj/prop/create/delete.md) - delete an object's [property](/web/js/val/obj/prop.md).
* :no\_entry:[delete of an unqualified identifier in strict mode❗️](/web/js/err/syntax/delete-of-an-unqualified-identifier-in-strict-mode.md)
  {% 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 %}
