findAll - nodef/extra-entries GitHub Wiki

Find values passing a test.

Alternatives: find, findAll. Similar: find, search, searchValue.

function findAll(x, ft)
// x:  entries
// ft: test function (v, k, x)
const entries = require('extra-entries');

var x = ["a", 1], ["b", 2], ["c", 3], ["d", 4](/nodef/extra-entries/wiki/"a",-1],-["b",-2],-["c",-3],-["d",-4);
[...entries.findAll(x, v => v % 2 === 0)];
// → [ 2, 4 ]                      ^                   ^

[...entries.findAll(x, v => v % 8 === 0)];
// → []

References