-
Notifications
You must be signed in to change notification settings - Fork 0
search
Subhajit Sahu edited this page Jun 18, 2020
·
14 revisions
Finds key of an entry passing a test. 🏃 📼 📦 🌔 📒
Alternatives: search, searchAll.
Similar: find, search, searchValue.
lists.search(x, ft);
// x: lists
// ft: test function (v, k, x)
const entries = require('extra-entries');
var x = [['a', 1], ['b', 2], ['c', 3], ['d', 2]];
entries.search(x, v => v === 2);
// 'b' ^
entries.search(x, v => v === 4);
// undefined