资 源 简 介
Sample implementation of the six basic operations defined in Set Theory. Contains both browser agnostic versions (using Array.prototype) and JQuery (extending $ with a sets object and the individual functions), and QUnit tests to verify correctness.
Taken from Wikipedia:
http://en.wikipedia.org/wiki/Settheory#Basicconcepts
Union of the sets A and B is the set whose members are members of at least one of A or B. The union of {1, 2, 3} and {2, 3, 4} is the set {1, 2, 3, 4}.
Intersection of the sets A and B is the set whose members are members of both A and B. The intersection of {1, 2, 3} and {2, 3, 4} is the set {2, 3}.
Complement of set A relative to set U is the set of all members of U that are not members of A. This terminology is most commonly employed when U is a universal set, as in the study of Venn diagrams. This operation is also called the set difference of U and A, denoted U