Skip to content
Subhajit Sahu edited this page Feb 3, 2021 · 17 revisions

Finds a value passing s test. 🏃 📼 📦 🌔 📒

Alternatives: find, findAll.
Similar: find, search, searchValue.

set.find(x, ft);
// x:  a set
// ft: test function (v, v, x)
const set = require('extra-set');

var x = new Set([1, 2, 3, 4]);
set.find(x, v => v % 2 === 0);
// 2                             ^

set.find(x, v => v % 8 === 0);
// undefined

references

Clone this wiki locally