findAll - nodef/extra-set GitHub Wiki

Find all values passing a test.

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

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

var x = new Set([1, 2, 3, 4]);
set.findAll(x, v => v % 2 === 0);
// → [ 2, 4 ]

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

References