is-integer-x
v2.2.2
Published
Determine whether the passed value is an integer.
Downloads
2,703
Maintainers
Readme
is-integer-x
Determine whether the passed value is an integer.
module.exports(value)
⇒ boolean ⏏
This method determines whether the passed value is an integer.
Kind: Exported function
Returns: boolean - A Boolean indicating whether or not the given value is an integer.
| Param | Type | Description | | ----- | --------------- | -------------------------------------------- | | value | * | The value to be tested for being an integer. |
Example
import isInteger from 'is-integer-x';
console.log(isInteger(0)); // true
console.log(isInteger(1)); // true
console.log(isInteger(-100000)); // true
console.log(isInteger(0.1)); // false
console.log(isInteger(Math.PI)); // false
console.log(isInteger(NaN)); // false
console.log(isInteger(Infinity)); // false
console.log(isInteger(-Infinity)); // false
console.log(isInteger('10')); // false
console.log(isInteger(true)); // false
console.log(isInteger(false)); // false
console.log(isInteger([1])); // false