# type

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

{% hint style="warning" %}
🚧
{% endhint %}

{% tabs %}
{% tab title="⭐️ 重點" %}
{% hint style="warning" %}
there is <mark style="color:red;">**no**</mark> <mark style="color:purple;">**type**</mark> <mark style="color:yellow;">**associated**</mark> with [variable declaration](/web/js/variable/declare.md):exclamation:
{% endhint %}

{% hint style="info" %}
The <mark style="color:yellow;">**operands**</mark> of [comparison operator](/web/js/grammar/op/relational/compare.md) may be <mark style="color:yellow;">**of**</mark>**&#x20;**<mark style="color:red;">**any**</mark> <mark style="color:purple;">**type**</mark>.
{% endhint %}
{% endtab %}

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

* <mark style="color:yellow;">**main topics**</mark>
  * [type name](/web/js/val/type/name.md)
  * [custom type name](/web/js/val/type/name/custom-type-name.md)
  * [Broken mention](broken://pages/l1v0bwCArjuB3OOG3NfE)
* <mark style="color:yellow;">**type terms**</mark>
  * [falsy](/web/js/val/type/falsy.md)
  * [statically typed](/web/js/val/type/term/static.md)
  * [dynamically typed](/web/js/val/type/term/dynamic.md) - JS is a dynamically typed language.
* <mark style="color:yellow;">**value types**</mark>
  * [primitive](/web/js/val/prim.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> [Boolean](/web/js/val/prim/boolean.md)
  * [object](/web/js/val/obj.md)
    * [class](/web/js/val/class.md) <mark style="color:yellow;">**/**</mark> [Array](/web/js/val/builtin/arr.md) <mark style="color:yellow;">**/**</mark> [Set](/web/js/val/builtin/set.md) <mark style="color:yellow;">**/**</mark> [Map](/web/js/val/builtin/map.md)
* <mark style="color:yellow;">**helper functions**</mark>
  * [type functions](/web/js/val/type/type-functions.md)
    {% endtab %}

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

* [typeof](/web/js/val/type/name/typeof.md) <mark style="color:yellow;">**determines**</mark> the [type](/web/js/val/type.md) of a [value](/web/js/val.md). (:point\_right: [type name](/web/js/val/type/name.md))
* [typeName()](/web/js/val/type/name/typename.md)
* [TypeScript](/web/appendix/typescript.md) is a JavaScript dialect that checks types.
  {% endtab %}

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

* [ ] Eloquent JavaScript > [Types](https://eloquentjavascript.net/08_error.html#h_k7niieKEJG)
  {% endtab %}

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

* [typeof](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof)
* [instanceof](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof)
  {% endtab %}

{% tab title="🚧" %}

* [ ] type conversion table
* [ ] what is "type" in JS? 🚧
* [ ] how to determine a value's "type"? 🚧
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lochiwei.gitbook.io/web/js/val/type.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
