> 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/val/prim.md).

# primitive

🚧 under construction

[JS](/web/js.md) ⟩ [value](/web/js/val.md) ⟩ primitive

{% hint style="success" %} <mark style="color:yellow;">**7**</mark> primitive data types:&#x20;

* <mark style="color:yellow;">**5**</mark>**&#x20;**<mark style="color:green;">**with**</mark> [<mark style="color:blue;">**wrapper**</mark>](/web/js/val/prim/wrapper.md)：\
  [String](/web/js/val/prim/str.md) <mark style="color:yellow;">**/**</mark> [Number](/web/js/val/prim/num.md) <mark style="color:yellow;">**/**</mark> [BigInt](/web/js/val/prim/bigint.md) <mark style="color:yellow;">**/**</mark> [Boolean](/web/js/val/prim/boolean.md) <mark style="color:yellow;">**/**</mark> [Symbol](/web/js/val/prim/symbol.md)&#x20;
* <mark style="color:yellow;">**2**</mark>**&#x20;**<mark style="color:red;">**without**</mark> [<mark style="color:blue;">**wrapper**</mark>](/web/js/val/prim/wrapper.md)：(:warning: [<mark style="color:red;">**can't call methods, no properties**</mark>](/web/js/err/type/cannot-read-properties-of-nullish.md)):exclamation:\
  [undefined](/web/js/val/prim/undefined.md) <mark style="color:yellow;">**/**</mark> [null](/web/js/val/prim/null.md).&#x20;
  {% endhint %}

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

* <mark style="color:red;">**7**</mark>**&#x20;**<mark style="color:yellow;">**types of primitives**</mark>
  * [null](/web/js/val/prim/null.md) <mark style="color:yellow;">**/**</mark> [undefined](/web/js/val/prim/undefined.md)&#x20;
  * [Boolean](/web/js/val/prim/boolean.md) <mark style="color:yellow;">**/**</mark> [Number](/web/js/val/prim/num.md) <mark style="color:yellow;">**/**</mark> [String](/web/js/val/prim/str.md)
  * [BigInt](/web/js/val/prim/bigint.md) <mark style="color:yellow;">**/**</mark> [Symbol](/web/js/val/prim/symbol.md)
* <mark style="color:yellow;">**tools**</mark>
  * [isPrimitive()](/web/js/val/type/type-functions/isprimitive.md) <mark style="color:yellow;">**/**</mark> [isObject()](/web/js/val/type/type-functions/isobject.md)
    {% endtab %}

{% tab title="⭐️ 重點" %}
{% hint style="warning" %}
All primitives are <mark style="color:red;">**immutable**</mark>**.**
{% endhint %}

{% hint style="danger" %} <mark style="color:purple;">**null**</mark> & <mark style="color:purple;">**undefined**</mark>&#x20;

* have <mark style="color:red;">**no object wrappers**</mark>, <mark style="color:orange;">**methods**</mark>/<mark style="color:orange;">**properties**</mark> <mark style="color:red;">**not available**</mark>.&#x20;
* hava <mark style="color:red;">**no**</mark> corresponding [prototype](/web/js/val/func/prototype.md) either.
  {% endhint %}
  {% endtab %}

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

* 👉 [isPrimitive()](/web/js/val/type/type-functions/isprimitive.md)
* :star: [sloppy equality (==)](/web/js/grammar/op/relational/equal/sloppy-equality.md) / [strict equality (===)](/web/js/grammar/op/relational/equal/strict-equality.md)
  {% endtab %}

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

* [ ] JS.info ⟩ Native prototypes ⟩ [primitives](https://javascript.info/native-prototypes#primitives)
  {% endtab %}

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

* [Primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)
  {% endtab %}

{% tab title="🚧" %}

* [ ] Symbol's wrapper?
  {% endtab %}
  {% endtabs %}
