is-binary-array
v1.0.1
Published
The fastest way to check if an array contains binary digits only
Downloads
7
Maintainers
Readme
is-binary-array
The fastest way to check if an array contains binary digits only
Install
$ npm install is-binary-array
Usage
const isBinaryArray = require('is-binary-array');
isBinaryArray([0]);
//=> true
isBinaryArray([0, 1, 1, 0]);
//=> true
isBinaryArray([0, 1, 1, 8]);
//=> false
isBinaryArray([100]);
//=> false
isBinaryArray([-1, 0, 1]);
//=> false
isBinaryArray(123);
//=> 'Expected an array, got number'
License
MIT © JeffMinsungKim