time-to-botec/js/node_modules/@stdlib/assert/is-primitive-array
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

isPrimitiveArray

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

Usage

var isPrimitiveArray = require( '@stdlib/assert/is-primitive-array' );

isPrimitiveArray( value )

Tests if a value is an array-like object containing only JavaScript primitives.

var bool = isPrimitiveArray( [ '3', 2, null ] );
// returns true

bool = isPrimitiveArray( [ {}, 2, 1 ] );
// returns false

bool = isPrimitiveArray( [ new String( 'abc' ), '3.0' ] );
// returns false

Examples

var Number = require( '@stdlib/number/ctor' );
var isPrimitiveArray = require( '@stdlib/assert/is-primitive-array' );

var bool = isPrimitiveArray( [ '3', 2, null ] );
// returns true

bool = isPrimitiveArray( [ void 0, true ] );
// returns true

bool = isPrimitiveArray( [ new String( 'abc' ), false ] );
// returns false

bool = isPrimitiveArray( [ new Number( 2 ), null ] );
// returns false

bool = isPrimitiveArray( [ function noop() {}, null ] );
// returns false