Question:
In PHP, we have a limit for values of type int
, which is demonstrated by the constant PHP_INT_MAX
.
echo PHP_INT_MAX; // Imprime: 9223372036854775807
And in javascript? How do I find the maximum accepted value for a Number
(integer) object?
Answer:
In JS this representation is like this:
Number.MAX_VALUE
And its value is approximately 1.79E+308. That is, 179 followed by 306 digits.
See the code:
document.getElementById("demo").innerHTML = Number.MAX_VALUE;
<p id="demo"></p>
Fonte: Number.MAX_VALUE – JavaScript | MDN