Skip to content

findAll

Subhajit Sahu edited this page Feb 3, 2021 · 15 revisions

Finds values passing a test. 📦 😺 🏃 📼 🌔 📜 📰 📘

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


map.findAll(x, ft);
// x:  a map
// ft: test function (v, k, x)
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);
// []


References

Clone this wiki locally