The Precision Cliff
luljs still worksCount past a certain integer and the numbers start skipping.
In 2026: Still works. JavaScript numbers are 64-bit floats, so only integers up to Number.MAX_SAFE_INTEGER, about nine quadrillion, are exact. Past it the gaps between representable values grow wider than 1, so 9999999999999999 rounds to 10000000000000000 and x + 1 === x can be true.
Where it came from: A consequence of numbers being IEEE 754 doubles: integers stay exact only up to Number.MAX_SAFE_INTEGER, documented on MDN. MDN ↗
<script>
document.write("<p><code>9999999999999999</code> is <b>" + 9999999999999999 + "</b></p>");
document.write("<p><code>Number.MAX_SAFE_INTEGER</code> is <b>" + Number.MAX_SAFE_INTEGER + "</b></p>");
document.write("<p><code>MAX_SAFE_INTEGER + 1 === MAX_SAFE_INTEGER + 2</code> is <b>" + (Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2) + "</b></p>");
</script>