| > BigInt is a built-in object that provides a way to represent whole numbers larger than 2^53 - 1, which is the largest number JavaScript can reliably represent with the Number primitive and represented by the Number.MAX_SAFE_INTEGER constant. Isn't this wrong? JavaScript's Number type can represent some integers vastly greater than this. [0] What's special about Number.MAX_SAFE_INTEGER, if I understand correctly, is that it's the smallest integer such that (Number.MAX_SAFE_INTEGER + 1) is not guaranteed to be represented faithfully by the Number type. Given the topic, I don't think I'm being pedantic. edit On second thought, I could well be mistaken. The definition of JavaScript's Number type might be such that no guarantees are made about which integers greater than Number.MAX_SAFE_INTEGER can be represented exactly. edit 2 Nope, Number.MAX_VALUE is defined to be an integer. [0] Which is to say, the largest whole number that can be represented is Number.MAX_VALUE, not Number.MAX_SAFE_INTEGER. Of course, it's not the case that Number is guaranteed to be able to exactly represent all non-negative integers less than Number.MAX_VALUE, but that isn't the same thing. The article appears to get this wrong. [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... |