Skip to content

invalidred/is-whole-number-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-whole-number-array

isWholeNumberArray is a module that takes an array and it checks if the elements in the array are whole numbers. The elements can be string whole number or just whole numbers. Built in ES6, transpiled to ES5 using babel.

Installation

npm install is-whole-number-array --save

Usage

var isWholeNumberArray = require('is-whole-number-array');

var wholeNumberArray = [1, 2, 3];
var stringWholeNumbersArray = ['1', '2', '3'];
var realNumberArray = [1.1, 2.2, 3.3];
var stringRealNumberArray = ['1.1', '2.2', '3.3'];

console.log(isWholeNumberArray(wholeNumberArray)); // true
console.log(isWholeNumberArray(stringWholeNumbersArray)); // true
console.log(isWholeNumberArray(realNumberArray)); // false
console.log(isWholeNumberArray(stringRealNumberArray)); // false

Run Code Sample

node example.js

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Release History

  • 2015-09-30 1.0.2 Initial release

License

MIT license; see LICENSE.

(c) 2015 by Abdul Khan and Alexey Novak

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •