Small correction, but it's optimized to int31 by all the current engines with the last bit used for tagging.
BigInt is now available on Firefox and Chrome (with JSC/Safari support in the works). That gives arbitrarily-large integers (with the JIT deciding the best size.
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...