@stdlib/assert-is-truthy-array
v0.2.2
Published
Test if a value is an array-like object containing only truthy values.
Downloads
26
Readme
isTruthyArray
Test if a value is an array-like object containing only truthy values.
Installation
npm install @stdlib/assert-is-truthy-array
Usage
var isTruthyArray = require( '@stdlib/assert-is-truthy-array' );
isTruthyArray( value )
Tests if a value
is an array-like object
containing only truthy values.
var bool = isTruthyArray( [ [], {} ] );
// returns true
bool = isTruthyArray( [ '', null, void 0, false, 0, NaN ] );
// returns false
Examples
var isTruthyArray = require( '@stdlib/assert-is-truthy-array' );
var bool = isTruthyArray( [ [], {}, true, 'a', 5, -5 ] );
// returns true
bool = isTruthyArray( [ null, '', NaN, 0, void 0, false ] );
// returns false
bool = isTruthyArray( [] );
// returns false
bool = isTruthyArray( true );
// returns false
bool = isTruthyArray( {} );
// returns false
See Also
@stdlib/assert-is-falsy-array
: test if a value is an array-like object containing only falsy values.@stdlib/assert-is-truthy
: test if a value is truthy.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.