-
Notifications
You must be signed in to change notification settings - Fork 0
find
Subhajit Sahu edited this page Dec 22, 2022
·
16 revisions
Find first value passing a test (default order).
Alternatives: find, findAll.
Similar: find, search, searchValue.
function find(x, ft)
// x: ientries
// ft: test function (v, k, x)
const ientries = require('extra-ientries');
var x = [["a", 1], ["b", 2], ["c", 3], ["d", 4]];
ientries.find(x, v => v % 2 === 0);
// → 2 ^
ientries.find(x, v => v % 8 === 0);
// → undefined