-
Notifications
You must be signed in to change notification settings - Fork 1
findAll
Subhajit Sahu edited this page Jun 12, 2020
·
15 revisions
Finds values of entries passing a test. 🏃 [:vhs:] 📦 🌔 📒
Alternatives: find, findAll.
Similar: find, search, searchValue.
map.findAll(x, fn, [ths]);
// x: a map
// fn: test function (v, k, x)
// ths: this argument
const map = require('extra-map');
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);
// []