Skip to content
Subhajit Sahu edited this page May 19, 2020 · 18 revisions

Checks if all values satisfy a test. 🏃 📼 📦 🌔 📒

Similar: some, every.

array.every(x, fn, [ths]);
// x:   an array
// fn:  test function (v, i ,x)
// ths: this argument
const array = require('extra-array');

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

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

references

Clone this wiki locally