> 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/token/literal.md).

# literal

🚧 施工中

[JS](/web/js.md) ⟩ [grammar](/web/js/grammar.md) ⟩ [token](/web/js/grammar/token.md) ⟩ literal

{% hint style="success" %}
([token](/web/js/grammar/token.md)) a <mark style="color:yellow;">**data**</mark> [value](/web/js/val.md) that <mark style="color:yellow;">**appears directly**</mark> in a program.

```javascript
3.14        // number (numeric literal)
"hello"     // string
true        // boolean
null        // absence of an object
```

{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}

* [object literal](/web/js/val/obj/create/obj.md)
* [array literal](/web/js/val/builtin/arr/create/arr.md)
* [template literal](/web/js/val/prim/str/template-literal.md)
* Null literal - [null](/web/js/val/prim/null.md)
* bealean literals - true, false
* [numeric literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#numeric_literals)
  * octal literal / hexadecimal literal / ...
* [string literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#string_literals)
* [regex literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#regular_expression_literals)
  {% endtab %}

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

* :bulb:a <mark style="color:purple;">**literal**</mark> is an [expression](/web/js/grammar/statement/expr.md).
* [String](/web/js/val/prim/str.md)
* [octal literals not allowed in strict mode❗️](/web/js/err/syntax/octal-literals-not-allowed-in-strict-mode.md)
* [strict mode](/web/js/concept/env/js-engine/mode/strict-mode.md)
  {% endtab %}

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

* [Lexical grammar](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar) ⟩ [Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#literals)
  * [null](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null)
* [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
* ECMA ⟩ [Lexical Grammar](https://262.ecma-international.org/13.0/#sec-ecmascript-language-lexical-grammar) ⟩ [12.8 Literals](https://262.ecma-international.org/13.0/#sec-ecmascript-language-lexical-grammar-literals)
  {% endtab %}

{% tab title="🚧" %}

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