Html page:
<button onclick="myFunction()">Try it</button>
<p id="P8"></p>
Javascript page:
<script>
function myFunction() {
var res = "";
res
= res + Number.isSafeInteger(123) + ":
123<br>";
res
= res + Number.isSafeInteger(-123) + ":
-123<br>";
res
= res + Number.isSafeInteger(5 - 2) + ":
5-2<br>";
document.getElementById("demo").innerHTML
= res;
}
</script>
Output:
true: 123
true: -123
true: 5-2
No comments:
Post a Comment