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