RangeError: A number "out of range" has occurred
You cannot set the number of significant digits of a number to 500
<!DOCTYPE html> <html> <body> <p id="demo"> <script> var num = 1;/*ww w . j av a 2 s . com*/ try { num.toPrecision(500); } catch(err) { document.getElementById("demo").innerHTML = err.name; } </script> </body> </html>