运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 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 true a safe integer? " + Number.isSafeInteger(true) + "<br>" + "Is false a safe integer? " + Number.isSafeInteger(false) + "<br>" + "Is Infinity a safe integer? " + Number.isSafeInteger(Infinity) + "<br>" + "Is -Infinity a safe integer? " + Number.isSafeInteger(-Infinity); document.getElementById("demo").innerHTML = result; </script> </body> </html>