Skip to content

Files

Latest commit

dc08968 · Sep 26, 2022

History

History

is-plain-object-array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 26, 2022
May 5, 2021
May 5, 2021
Sep 23, 2022
May 5, 2021
Sep 7, 2021
May 5, 2021

README.md

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