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));
console.log(isWholeNumberArray(stringWholeNumbersArray));
console.log(isWholeNumberArray(realNumberArray));
console.log(isWholeNumberArray(stringRealNumberArray));
Run Code Sample
npm start
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