Skip to content

Latest commit

 

History

History

is-ndarray-like

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

isndarrayLike

Test if a value is ndarray-like.

Usage

var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );

isndarrayLike( value )

Tests if a value is ndarray-like.

var ctor = require( '@stdlib/ndarray/ctor' );

var ndarray = ctor( 'generic', 2 );
var arr = ndarray( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );

var bool = isndarrayLike( arr );
// returns true

Examples

var ctor = require( '@stdlib/ndarray/ctor' );
var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );

var ndarray = ctor( 'generic', 2 );
var arr = ndarray( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );

var out = isndarrayLike( arr );
// returns true

out = isndarrayLike( [ 1, 2, 3, 4 ] );
// returns false

out = isndarrayLike( {} );
// returns false

out = isndarrayLike( null );
// returns false