Skip to content

Files

Latest commit

e1a805c · Feb 9, 2018

History

History

is-integer-array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 2, 2018
Jun 17, 2017
Feb 3, 2018
Feb 9, 2018
Feb 8, 2018
Feb 2, 2018
Nov 2, 2017

isIntegerArray

Test if a value is an array-like object containing only integers.

Usage

var isIntegerArray = require( '@stdlib/assert/is-integer-array' );

isIntegerArray( value )

Tests if a value is an array-like object containing only integer values.

var bool = isIntegerArray( [ -3, new Number(3) ] );
// returns true

bool = isIntegerArray( [ -3, 'abc' ] );
// returns false

isIntegerArray.primitives( value )

Tests if a value is an array-like object containing only primitive integer values.

var bool = isIntegerArray.primitives( [ -1.0, 0.0, 4.0 ] );
// returns true

bool = isIntegerArray.primitives( [ -1.0, 2.2 ] );
// returns false

bool = isIntegerArray.primitives( [ -3.0, new Number(2.0) ] );
// returns false

isIntegerArray.objects( value )

Tests if a value is an array-like object containing only Number objects having integer values.

var bool = isIntegerArray.objects( [ new Number(-1.0), new Number(2.0) ] );
// returns true

bool = isIntegerArray.objects( [ -1.0, 0.0, 1.0 ] );
// returns false

bool = isIntegerArray.objects( [ -3.0, new Number(1.0) ] );
// returns false

Examples

var isIntegerArray = require( '@stdlib/assert/is-integer-array' );

var bool = isIntegerArray( [ -5, 0, 2, 5 ] );
// returns true

bool = isIntegerArray( [ -4, -3, 1, 3 ] );
// returns true

bool = isIntegerArray( [ -1, new Number( -6 ), 2 ] );
// returns true

bool = isIntegerArray( [ -1, 'abc', 3 ] );
// returns false

bool = isIntegerArray( [ -2.3, 0, 3 ] );
// returns false

bool = isIntegerArray( [] );
// returns false