---
description: it's best practice to use "strict mode".
---

# always use strict mode

[JS](../../../../..) ⟩ [concepts](../../../../../../browser/concepts) ⟩ [strict mode]() ⟩ always use strict mode

{% hint style="success" %}
<mark style="color:yellow;">**in**</mark> [](<> "mention")：

* :white\_check\_mark:[eval-has-its-own-scope-in-strict-mode](eval-has-its-own-scope-in-strict-mode "mention").
* :white\_check\_mark: <mark style="color:red;">**no**</mark> [accidental-global-variable-in-sloppy-mode](../sloppy-mode/accidental-global-variable-in-sloppy-mode "mention")
* :white\_check\_mark: <mark style="color:red;">**no**</mark> [duplicate](../../../../../val/func/param/duplicate "mention"):exclamation:. ( 👉 [more ...](../../../../../err/syntax/duplicate-parameter) )
* :white\_check\_mark: <mark style="color:red;">**can't**</mark> [delete](../../../../../val/obj/prop/create/delete "mention") <mark style="color:yellow;">**variables**</mark>/<mark style="color:yellow;">**functions**</mark>. ( 👉 [more ...](../../../../../err/syntax/delete-of-an-unqualified-identifier-in-strict-mode) )
* :white\_check\_mark: <mark style="color:red;">**no**</mark>**&#x20;**<mark style="color:yellow;">**octal literals**</mark> ( 👉 [more ...](../../../../../err/syntax/octal-literals-not-allowed-in-strict-mode) )
{% endhint %}

{% tabs %}
{% tab title="👥 相關" %}
* [param](../../../../../val/func/param "mention")
* [eval](../../../../../scope/global/object/eval "mention")
* [variable](../../../../../scope/global/variable "mention")
{% endtab %}

{% tab title="📗 參考" %}
* [ ] &#x20;[`eval` of strict mode code does not introduce new variables into the surrounding scope](https://whereswalden.com/2011/01/10/new-es5-strict-mode-support-new-vars-created-by-strict-mode-eval-code-are-local-to-that-code-only/)
* [ ] 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="📘 手冊" %}
* [Strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode)
{% endtab %}
{% endtabs %}
