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