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

# delete of an unqualified identifier in strict mode❗️

[JS](../..) ⟩ [error](..) ⟩ [SyntaxError]() ⟩ delete of an unqualified identifier in strict mode

{% hint style="danger" %}
[<mark style="color:red;">**SyntaxError**</mark>]()<mark style="color:red;">**:**</mark> [<mark style="color:yellow;">**delete of an unqualified identifier in strict mode**</mark>](delete-of-an-unqualified-identifier-in-strict-mode):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:[id](../../grammar/token/id "mention") ⟩ [unqualified-for-delete](../../val/obj/prop/create/delete/unqualified-for-delete "mention")
* [delete](../../val/obj/prop/create/delete "mention")
* [delete](../../variable/delete "mention")
* [strict-mode](../../concept/env/js-engine/mode/strict-mode "mention")
{% 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 %}
