> 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/grammar/directive/use-strict.md).

# 'use strict'

[JS](/web/js.md) ⟩ [grammar](/web/js/grammar.md) ⟩ [directive](/web/js/grammar/directive.md) ⟩ 'use strict'

{% hint style="success" %}
([directive](/web/js/grammar/directive.md)) indicate the <mark style="color:yellow;">**code**</mark> that follows is [strict mode](/web/js/concept/env/js-engine/mode/strict-mode.md), can appear <mark style="color:yellow;">**only at the**</mark>**&#x20;**<mark style="color:red;">**start**</mark> of a <mark style="color:yellow;">**script**</mark> / <mark style="color:yellow;">**function body**</mark>.

```javascript
'use strict';    // enters strict mode
```

{% endhint %}

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

* [strict mode](/web/js/concept/env/js-engine/mode/strict-mode.md)
  {% endtab %}

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

* [ ] [JavaScript: The Definitive Guide](/web/master/ref/javascript-the-definitive-guide.md) ⟩ 5.6.3 "use strict"
  {% endtab %}

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

* [Strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode)
  {% endtab %}
  {% endtabs %}
