Skip to content
Subhajit Sahu edited this page Feb 3, 2021 · 20 revisions

Check if all values satisfy a test.

Similar: some, every.


function every(x, ft)
// x:  an iterable
// ft: test function (v, i, x)
const xiterable = require('extra-iterable');

var x = [1, 2, -3, -4];
xiterable.every(x, v => v > 0);
// → false

xiterable.every(x, v => v > -10);
// → true


References

Clone this wiki locally