Programming, Computer Science, JavaScript, Functional Programming.
NumberSetI, set2: NumberSetI) { this.set1 = set1; this.set2 = set2; } add(n: number) { return new Insert(n, this); } isEmpty() { return this.set1.isEmpty() && this.set2.isEmpty(); } has(n: number) { return this.set1.has(n) || this.set2.has(n); } union(set: NumberSetI) { return new Union(this, set);