An open API service indexing awesome lists of open source software.

https://github.com/xotic750/is-integer-x

Determine whether the passed value is an integer.
https://github.com/xotic750/is-integer-x

browser isinteger javascript nodejs number

Last synced: 11 months ago
JSON representation

Determine whether the passed value is an integer.

Awesome Lists containing this project

README

          


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**

```js
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
```