Skip to content

isInteger implementation based on ES6 Number.isInteger specification

License

Notifications You must be signed in to change notification settings

Sahadar/isInteger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isInteger

isInteger implementation based on ES6 Number.isInteger specification

Build Status Dependency Status License

NPM isinteger link

Installation

  • download from Github
  • npm: npm install isinteger
  • bower: bower install isinteger

Description

If the target value is an integer, return true, otherwise return false. If the value is NaN or infinite, return false.

Examples

isInteger(0.1);     // false
isInteger(1);       // true
isInteger(Math.PI); // false
isInteger(-100000); // true
isInteger(NaN);     // false
isInteger(0);       // true
isInteger("10");    // false

For more working examples:

Check out tests file

License

MIT

About

isInteger implementation based on ES6 Number.isInteger specification

Resources

License

Stars

Watchers

Forks

Packages

No packages published