Learn Flexbox with Images
Use beautiful images to learn CSS Flexbox.
Find out moreNumber.isInteger() checks if its argument is an integer. If so, it returns true
. Otherwise, the method returns false
.
Number.isInteger()
MethodNumber.isInteger()
accepts only one required argument. Here is the syntax:
Number.isInteger(value);
The value
argument represents the item you wish to test if it is an integer.
Number.isInteger()
MethodBelow are examples of the Number.isInteger()
method.
578
an integer?Number.isInteger(578);
// The invocation above will return: true
0.99
an integer?Number.isInteger(0.99);
// The invocation above will return: false
"test"
an integer?Number.isInteger("test");
// The invocation above will return: false
300
an integer?Number.isInteger(-300);
// The invocation above will return: true
Number.isInteger(0);
// The invocation above will return: true
Math.PI
an integer?Number.isInteger(Math.PI);
// The invocation above will return: false