
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to check whether a value is a number in JavaScript?
To check whether a value is a number in JavaScript, use the isInteger() method. This method checks whether the value is a number or not.
Example
You can try to run the following code to check the value is a number or not −
<html> <head> <title>JavaScript isInteger() Method </title> </head> <body> <script> document.write(Number.isInteger(30)); document.write("<br>"+Number.isInteger(true)); document.write("<br>"+Number.isInteger(false)); document.write("<br>"+Number.isInteger(-30)); </script> </body> </html>
- Related Questions & Answers
- Check whether a number is a Fibonacci number or not JavaScript
- How to check whether a number is finite or not in JavaScript?
- How to check whether a value is a safe integer or not in JavaScript?
- How to check whether a JavaScript date is valid?
- How to check whether a checkbox is checked in JavaScript?
- How to check whether a checkbox is checked with JavaScript?
- How to check whether a Button is clicked with JavaScript?
- Check whether sum of digit of a number is Palindrome - JavaScript
- How to know whether a value is searched in Javascript sets?
- Finding whether a number is triangular number in JavaScript
- How to check whether a NaN is a NaN or not in JavaScript?
- JavaScript: How to check whether an array includes a particular value or not?
- How to check whether an array is a true array in JavaScript?
- How to check whether a number is prime or not using Python?
- Java Program to Check whether the input number is a Neon Number
Advertisements