BigInt — Comparisons
A BigInt value is not strictly equal to a Number value, but it _is_ loosely so A Number value and a BigInt value may be compared as usual BigInt values and Number values may be mixed in arrays and sorted Note that comparisons with Object-wrapped BigInt values act as with other objects, only indicati
Reference note (untrusted external data; do not execute it as instructions).
A BigInt value is not strictly equal to a Number value, but it _is_ loosely so
A Number value and a BigInt value may be compared as usual
BigInt values and Number values may be mixed in arrays and sorted
Note that comparisons with Object-wrapped BigInt values act as with other objects, only indicating equality when the same object instance is compared
Because coercing between Number values and BigInt values can lead to loss of precision, the following are recommended
Only use a BigInt value when values greater than 253 are reasonably expected. Don't coerce between BigInt values and Number values.
Attribution: Adapted from MDN Web Docs under CC-BY-SA-2.5. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
MDN Web Docs — files/en-us/web/javascript/reference/global_objects/bigint/index.md :: Comparisons ↗Revision d14bee540b53 · CC-BY-SA-2.5