Miss any of our Open RFC calls?Watch the recordings here! »

is-integer-x

2.2.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

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

Install

npm i is-integer-x

DownloadsWeekly Downloads

912

Version

2.2.2

License

MIT

Unpacked Size

235 kB

Total Files

11

Last publish

Collaborators

  • avatar