---
description: 🚧 under construction -> example
---

# BigInt

[JS](../..) ⟩ [value](..) ⟩ [primitive]() ⟩ bigint

{% hint style="success" %}
a [primitive wrapper object](https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript) used to represent and manipulate [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) `bigint`values — which are [too large](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) to be represented by the `number` [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
{% endhint %}

{% tabs %}
{% tab title="🧨 雷區" %}
{% hint style="danger" %}
<mark style="color:purple;">**BigInt**</mark> <mark style="color:red;">**can't**</mark>**&#x20;**<mark style="color:yellow;">**be**</mark> [**converted**](../type/convert) **to** [num](num "mention"):exclamation:(:point\_right: [<mark style="color:red;">**TypeError**</mark>](../../err/type/no-bigint-to-num) )
{% endhint %}

{% hint style="danger" %}
[arithmetic](../../grammar/op/arithmetic "mention")(s) <mark style="color:red;">**do not**</mark>**&#x20;**<mark style="color:yellow;">**allow**</mark> to <mark style="color:yellow;">**mix**</mark> <mark style="color:purple;">**BigInt**</mark> and [num](num "mention"):exclamation:
{% endhint %}

{% hint style="success" %}
[bitwise](../../grammar/op/arithmetic/bitwise "mention")(s) <mark style="color:green;">**can**</mark>**&#x20;**<mark style="color:yellow;">**be used**</mark> with <mark style="color:purple;">**BigInt**</mark>.
{% endhint %}
{% endtab %}

{% tab title="⭐️ 重點" %}
{% hint style="success" %}
[compare](../../grammar/op/relational/compare "mention")(s) <mark style="color:red;">**do**</mark>**&#x20;**<mark style="color:yellow;">**allow**</mark> to <mark style="color:yellow;">**mix**</mark> <mark style="color:purple;">**BigInt**</mark> and [num](num "mention"):exclamation:
{% endhint %}
{% endtab %}

{% tab title="👥 相關" %}
* :no\_entry: <mark style="color:yellow;">**possible**</mark>**&#x20;**<mark style="color:red;">**errors**</mark>**：**
  * TypeError: Cannot convert a BigInt value to a number (:point\_right: [convert](../type/convert "mention"))
{% endtab %}

{% tab title="📗 參考" %}
* [ ] [javascript-the-definitive-guide](../../../master/ref/javascript-the-definitive-guide "mention") ⟩ 3.2.5
{% endtab %}

{% tab title="📘 手冊" %}
* [ ] [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
* [ ] Glossary > [BigInt](https://developer.mozilla.org/en-US/docs/Glossary/BigInt)
* [ ] data type > [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#bigint_type)
{% endtab %}
{% endtabs %}
