Number.isInteger() to check Integer

Number.isInteger(input_number);
input_number: Input value

Return value is boolean. If the input number is an integer then true is returned , otherwise false
<script>
document.write(Number.isInteger(5)) // true 
document.write(Number.isInteger(-5)) // true 
document.write(Number.isInteger(0)) // true 
document.write(Number.isInteger(5.5)) // false
document.write(Number.isInteger(-5.5)) // false  
document.write(Number.isInteger('5')) // false
document.write(Number.isInteger('abc')) // false
</script>

What is NaN ?

Factors of a number To display factors of an input number, isInteger is used to check the user input number

Check string if it is a number or not
JavaScript Math Reference
Subscribe to our YouTube Channel here



plus2net.com










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer