> 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/err/syntax/delete-of-an-unqualified-identifier-in-strict-mode.md).

# delete of an unqualified identifier in strict mode❗️

only object's configurable properties are "qualified" for "delete", other identifiers are "unqualilfied".

[JS](/web/js.md) ⟩ [error](/web/js/err.md) ⟩ [SyntaxError](/web/js/err/syntax.md) ⟩ delete of an unqualified identifier in strict mode

{% hint style="danger" %}
[<mark style="color:red;">**SyntaxError**</mark>](/web/js/err/syntax.md)<mark style="color:red;">**:**</mark> [<mark style="color:yellow;">**delete of an unqualified identifier in strict mode**</mark>](/web/js/err/syntax/delete-of-an-unqualified-identifier-in-strict-mode.md):exclamation:
{% endhint %}

{% tabs %}
{% tab title="💈範例" %}

* replit：[delete in sloppy/strict mode](https://replit.com/@pegasusroe/delete-in-sloppystrict-mode#index.js)

```javascript
// 'use strict';    // ⭐ toggle sloppy/strict mode

const { log } = console;

// declarations
let x = 3.14;                            // variable
function f1() { log('f1'); }             // function declaration
let f2 = function() { log('f2'); }       // function expression
let fruits = ["Banana", "Orange"];       // array
let person = { name: 'John', age: 18 };  // object

// log
[
    //            mode:  //  sloppy                strict
    // -----------------------------------------------------------
    delete x,            // ❌ false               ⛔ SyntaxError
    x,                   // 3.14

    delete f1,           // ❌ false               ⛔ SyntaxError
    f1,                  // [Function: f1]

    delete f2,           // ❌ false               ⛔ SyntaxError
    f2,                  // [Function: f2]

    delete fruits[1],    // ✅ true                 ✅ true
    fruits,              // ['Banana', <empty>]     ['Banana', <empty>]

    delete person.age,   // ✅ true                 ✅ true
    person,              // { name: 'John' }        { name: 'John' }
    
].forEach(x => console.log(x));

// ⛔ SyntaxError: Delete of an unqualified identifier in strict mode.
```

{% endtab %}

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

* :star:[identifier](/web/js/grammar/token/id.md) ⟩ [unqualified identifier for delete](/web/js/val/obj/prop/create/delete/unqualified-for-delete.md)
* [delete](/web/js/val/obj/prop/create/delete.md)
* [can't delete variable/function❗️](/web/js/variable/delete.md)
* [strict mode](/web/js/concept/env/js-engine/mode/strict-mode.md)
  {% endtab %}

{% tab title="📗 參考" %}

* [ ] itHome ⟩ [你不可不知的 JavaScript 二三事](https://ithelp.ithome.com.tw/users/20112483/ironman/2016) ⟩&#x20;
  * [ ] [#Day12：看 Strict Mode 如何施展「還我漂亮拳」(1)](https://ithelp.ithome.com.tw/articles/10205275)
    {% endtab %}

{% tab title="📘 手冊" %}

* [ ] [SyntaxError: applying the 'delete' operator to an unqualified name is deprecated](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Delete_in_strict_mode) ⭐️
  {% endtab %}
  {% endtabs %}
