Skip to content

hasSubset

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

Checks if set has a subset.

Alternatives: has, hasSubset.
Similar: subset, subsets, hasSubset.


function hasSubset(x, y)
// x: a set
// y: search subset
const set = require('extra-set');

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

var y = new Set([2, -4]);
set.hasSubset(x, y);
// → false


References

Clone this wiki locally