setIsSubset

setIsSubset(set1, set2)

Try it yourself:


Test containment with setIsSubset

setIsSubset(A, B) tests whether every member of A is also a member of B. It returns a Boolean and is useful for validation and permission checks.

Example

{1,2} is a subset of {1,2,3}; the reverse is false. Use setDifference to see which members prevent containment and setIntersect to inspect overlap.

Caveats

The empty set is a subset of every set. Duplicates should not affect membership, but normalize uncertain inputs with setDistinct. For equal sets, both subset directions are true; use deepEqual if representation equality matters too.

Try Set Is Subset in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions