🎮 Set algebra, live

Edit Set A and Set B below and watch .union(), .intersection(), .difference(), and .symmetricDifference() update instantly — plus the three boolean checks, .isSubsetOf(), .isSupersetOf(), and .isDisjointFrom().

1 Edit the two sets

Type any comma-separated values — numbers or words. Duplicates and blanks are ignored, same as new Set(...).

2 The four set-algebra methods

      
Ready.

union merges both, intersection keeps only what's shared, difference keeps what's in one but not the other, and symmetricDifference keeps what's in exactly one. None of these mutate A or B — every line above returns a brand-new Set.

3 The three yes/no checks
A.isSubsetOf(B) — is every element of A also in B?
A.isSupersetOf(B) — does A contain every element of B?
A.isDisjointFrom(B) — do A and B share nothing at all?

These three always return a plain true or false — never a new Set.