Skip to content
Subhajit Sahu edited this page Dec 2, 2022 · 11 revisions

Check if set has a value.

Alternatives: has, hasSubset.
Similar: value, values, has.


function has(x, v)
// x: a set
// v: search value
const set = require('extra-set');

var x = new Set([1, 2, 3]);
set.has(x, 3);
// → true

set.has(x, 4);
// → false


References

Clone this wiki locally