1.0.1 • Published 10 years ago
iterable-every v1.0.1
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- AnIterableobject (has aSymbol.iteratorproperty).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
Booleanwhether all elements satisfy the predicate.
Passing an empty iterable always returns true.
License
MIT