Skip to content

findAll

Subhajit Sahu edited this page Dec 2, 2022 · 16 revisions

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

Clone this wiki locally