Skip to content

Latest commit

 

History

History

is-plain-object-array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 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 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