-
Notifications
You must be signed in to change notification settings - Fork 0
findAll
Subhajit Sahu edited this page Dec 28, 2022
·
14 revisions
Find values passing a test.
Alternatives: find, findAll.
Similar: find, search, searchValue.
function findAll(x, ft)
// x: lists
// ft: test function (v, k, x)
const xlists = require('extra-lists');
var x = [['a', 'b', 'c', 'd'], [1, 2, 3, 4]];
[...xlists.findAll(x, v => v % 2 === 0)];
// → [ 2, 4 ] ^ ^
[...xlists.findAll(x, v => v % 8 === 0)];
// → []