Skip to content

hasEntry

Subhajit Sahu edited this page Jun 28, 2020 · 10 revisions

Checks if map has an entry. 🏃 📼 📦 🌔 📒

Similar: entry, isEntry.

lists.isEntry(x, e, [fc], [fm]);
// x:  a map
// e:  entry?
// fc: compare function (a, b)
// fm: map function (v, k, x)
const lists = require('extra-lists');

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

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

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

references

Clone this wiki locally