iterable-every
v1.0.1
Published
Returns whether all elements in the iterable satisfy the predicate. Like Array.prototype.every.
Downloads
1
Readme
iterable-every
Returns whether all elements in the iterable satisfy the predicate. Like Array.prototype.every.
Usage
const every = require('iterable-every')
every(iterable, callback, thisArg)
iterable
- AnIterable
object (has aSymbol.iterator
property).callback
- The predicate to test with, called with the following arguments on each iteration:element
- The current element of the iterable object on the iteration.index
- The index of the iteration.iterable
- A reference toiterable
.
thisArg
- Optional. The object that will be used as the context forcallback
.- Returns: a
Boolean
whether all elements satisfy the predicate.
Passing an empty iterable always returns true.
License
MIT