Skip to content

Files

Latest commit

e9e94eb · Sep 7, 2021

History

History

is-plain-object-array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 13, 2021
May 5, 2021
May 5, 2021
Jun 13, 2021
May 5, 2021
Sep 7, 2021
May 5, 2021

isPlainObjectArray

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

Usage

var isPlainObjectArray = require( '@stdlib/assert/is-plain-object-array' );

isPlainObjectArray( value )

Tests if a value is an array-like object containing only plain objects.

var Number = require( '@stdlib/number/ctor' );

var bool = isPlainObjectArray( [ {}, { 'beep': 'boop' } ] );
// returns true

bool = isPlainObjectArray( [ {}, new Number(3.0) ] );
// returns false

bool = isPlainObjectArray( [ {}, '3.0' ] );
// returns false

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

bool = isPlainObjectArray( [ null, {} ] );
// returns false

Examples

var Number = require( '@stdlib/number/ctor' );
var isPlainObjectArray = require( '@stdlib/assert/is-plain-object-array' );

var bool = isPlainObjectArray( [ { 'beep': 'boop' }, {}, {} ] );
// returns true

bool = isPlainObjectArray( [ new Date(), new Number( 3 ) ] );
// returns false

bool = isPlainObjectArray( [ {}, new String( 'abc' ), {} ] );
// returns false

bool = isPlainObjectArray( [ [], {} ] );
// returns false

bool = isPlainObjectArray( [ 'a', 'b' ] );
// returns false

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

See Also