every-n
v2.0.1
Published
Like Array.prototype.every but for every n-tuple
Downloads
2
Readme
everyN
Like Array.prototype.every
but for every n-tuple
Install
npm i every-n
Usage
var everyTuple = require('every-n');
everyTuple(2, fixtures.isAscendingPair, [1, 5, 10]); // => true
everyTuple(2, fixtures.isAscendingPair, [8, 5, 10]); // => false
everyTuple(3, fixtures.isFibonacciTriple, [0, 1, 1, 2, 3, 5, 8, 13]); // => true
Please note the tuples are passed to the callback as individual arguments, not as an array.
See more examples of fixture callbacks.