# every
> Test whether all elements in a collection are truthy.
## Usage
```javascript
var every = require( '@stdlib/utils/every' );
```
#### every( collection )
Tests whether all elements in a `collection` are truthy.
```javascript
var arr = [ 1, 1, 1, 1, 1 ];
var bool = every( arr );
// returns true
```
If provided an empty `collection`, the function returns `true`.
```javascript
var bool = every( [] );
// returns true
```
## Notes
- A `collection` may be either an [`Array`][mdn-array], [`Typed Array`][mdn-typed-array], or an array-like [`Object`][mdn-object] (excluding `strings` and `functions`).
- The function does **not** skip `undefined` elements and is thus not optimized for sparse collections.
## Examples
```javascript
var randu = require( '@stdlib/random/base/randu' );
var every = require( '@stdlib/utils/every' );
var bool;
var arr;
var i;
arr = new Array( 100 );
for ( i = 0; i < arr.length; i++ ) {
arr[ i ] = ( randu() < 0.95 );
}
bool = every( arr );
// returns
```
[mdn-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
[mdn-object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object