Skip to content

hasEntry

Subhajit Sahu edited this page Dec 28, 2022 · 10 revisions

Check if ilists has an entry.

Alternatives: has, hasValue, hasEntry, hasSubset, hasPath.
Similar: randomEntry, entries, hasEntry.


function hasEntry(x, e, fc, fm)
// x:  ilists
// e:  search entry
// fc: compare function (a, b)
// fm: map function (v, k, x)
const xilists = require('extra-ilists');

var x = [['a', 'b', 'c'], [1, 2, -3]];
xilists.hasEntry(x, ['c', 3]);
// → false

xilists.hasEntry(x, ['c', 3], (a, b) => Math.abs(a) - Math.abs(b));
// → true

xilists.hasEntry(x, ['c', 3], null, v => Math.abs(v));
// → true


References

Clone this wiki locally