-
Notifications
You must be signed in to change notification settings - Fork 3
findAll
Subhajit Sahu edited this page Dec 8, 2022
·
12 revisions
Find values of entries passing a test.
function findAll(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.findAll(x, v => v % 2 === 0);
// → [ 2, 4 ] ^ ^
object.findAll(x, v => v % 8 === 0);
// → []