@stdlib/utils
Version:
Standard utilities.
30 lines (21 loc) • 726 B
Plain Text
{{alias}}( collection )
Tests whether all elements in a collection are truthy.
The function immediately returns upon encountering a falsy value.
If provided an empty collection, the function returns `true`.
Parameters
----------
collection: Array|TypedArray|Object
Input collection over which to iterate. If provided an object, the
object must be array-like (excluding strings and functions).
Returns
-------
bool: boolean
The function returns `true` if all elements are truthy; otherwise, the
function returns `false`.
Examples
--------
> var arr = [ 1, 1, 1, 1, 1 ];
> var bool = {{alias}}( arr )
true
See Also
--------