The set to check if it is a superset.
The set to check if it is a subset.
A boolean indicating whether the set is a superset of the subset.
This function will return true if all elements of the subset are found in the set, otherwise it will return false.
T - The type of elements in the set.
const set1 = new Set([1, 2, 3, 4]);
const set2 = new Set([2, 4]);
setIsSuperset(set1, set2);
//=> true
Generated using TypeDoc
Checks if a given set is a superset of another set. This function iterates over each element in the
subset
set and checks if it exists in theset
set. If any element in thesubset
set does not exist in theset
set, the function returnsfalse
. Otherwise, it returnstrue
.