-
Notifications
You must be signed in to change notification settings - Fork 0
findAll
Subhajit Sahu edited this page Jun 17, 2020
·
14 revisions
Finds values passing a test. 🏃 📼 📦 🌔 📒
Alternatives: find, findAll.
Similar: find, search, searchValue.
entries.findAll(x, fn);
// x: entries
// fn: test function (v, k, x)
const entries = require('extra-entries');
var x = new Map([['a', 1], ['b', 2], ['c', 3], ['d', 4]]);
map.findAll(x, v => v % 2 === 0);
// [ 2, 4 ] ^ ^
map.findAll(x, v => v % 8 === 0);
// []