# octal literals not allowed in strict mode❗️

[JS](https://lochiwei.gitbook.io/web/js) ⟩ [error](https://lochiwei.gitbook.io/web/js/err) ⟩ [SyntaxError](https://lochiwei.gitbook.io/web/js/err/syntax) ⟩ delete of an unqualified identifier in strict mode

{% hint style="danger" %}
[<mark style="color:red;">**SyntaxError**</mark>](https://lochiwei.gitbook.io/web/js/err/syntax)<mark style="color:red;">**:**</mark> [<mark style="color:yellow;">**octal literals not allowed in strict mode**</mark>](https://lochiwei.gitbook.io/web/js/err/syntax/octal-literals-not-allowed-in-strict-mode):exclamation:
{% endhint %}

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

* replit：[octal literals not allowed in strict mode](https://replit.com/@pegasusroe/octal-literals-not-allowed-in-strict-mode#index.js)

```javascript
let x = 010;    // ❗ octal literal
let y = 0x10;   // ⭐ hexadecimal literal

//  mode:    sloppy      strict
// -------------------------------------
x,        // ✅ 8       ⛔ SyntaxError
y,        // ✅ 16      ✅ 16

// ⛔ SyntaxError: Octal literals are not allowed in strict mode.
```

{% endtab %}

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

* [literal](https://lochiwei.gitbook.io/web/js/grammar/token/literal "mention")
* [strict-mode](https://lochiwei.gitbook.io/web/js/concept/env/js-engine/mode/strict-mode "mention")
* [always](https://lochiwei.gitbook.io/web/js/concept/env/js-engine/mode/strict-mode/always "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="📘 手冊" %}
\*
{% endtab %}

{% tab title="🚧" %}

* [ ] octal literal
  {% endtab %}
  {% endtabs %}
