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