time-to-botec/squiggle/node_modules/@stdlib/assert/is-array-like-object
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isArrayLikeObject

Test if a value is an array-like object.

Usage

var isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );

isArrayLikeObject( value )

Tests if a value is an array-like object.

var bool = isArrayLikeObject( [] );
// returns true

bool = isArrayLikeObject( { 'length': 10 } );
// returns true

If provided a string, the function returns false.

var bool = isArrayLikeObject( 'beep' );
// returns false

Examples

var Float64Array = require( '@stdlib/array/float64' );
var isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );

var bool = isArrayLikeObject( { 'length': 10 } );
// returns true

bool = isArrayLikeObject( [] );
// returns true

bool = isArrayLikeObject( new Float64Array( 10 ) );
// returns true

bool = (function test() {
    return isArrayLikeObject( arguments );
})();
// returns true

bool = isArrayLikeObject( 'beep' );
// returns false

bool = isArrayLikeObject( null );
// returns false

bool = isArrayLikeObject( void 0 );
// returns false

bool = isArrayLikeObject( 5 );
// returns false

bool = isArrayLikeObject( true );
// returns false

bool = isArrayLikeObject( {} );
// returns false

bool = isArrayLikeObject( function noop() {} );
// returns false