time-to-botec/squiggle/node_modules/@stdlib/assert/is-ndarray-like/docs/repl.txt

41 lines
773 B
Plaintext
Raw Normal View History

{{alias}}( value )
Tests if a value is ndarray-like.
Parameters
----------
value: any
Value to test.
Returns
-------
bool: boolean
Boolean indicating whether a value is ndarray-like.
Examples
--------
> var M = {};
> M.data = [ 0, 0, 0, 0 ];
> M.ndims = 2;
> M.shape = [ 2, 2 ];
> M.strides = [ 2, 1 ];
> M.offset = 0;
> M.order = 'row-major';
> M.dtype = 'generic';
> M.length = 4;
> M.flags = {};
> M.get = function get( i, j ) {};
> M.set = function set( i, j ) {};
> var bool = {{alias}}( M )
true
> bool = {{alias}}( [ 1, 2, 3, 4 ] )
false
> bool = {{alias}}( 3.14 )
false
> bool = {{alias}}( {} )
false
See Also
--------