运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Numbers</h1> <h2>The Number.isSafeInteger() Method</h2> <p>Number.isSafeInteger() returns true if a value is a safe integer and of datatype Number:</p> <p id="demo"></p> <p>Number.isSafeInteger() is not supported in Internet Explorer.</p> <script> let result = "Is 5-2 a safe integer? " + Number.isSafeInteger(5-2) + "<br>" + "Is 0 a safe integer? " + Number.isSafeInteger(0) + "<br>" + "Is 0.5 a safe integer? " + Number.isSafeInteger(0.5) + "<br>" + "Is 0/0 a safe integer? " + Number.isSafeInteger(0/0); document.getElementById("demo").innerHTML = result; </script> </body> </html>