Map.prototype.setD = function(k,v){ if (!this.has(k)){ this.set(k,v) // clog("SetD") return 1 } // clog("SetD0") } Set.prototype.isSuperset = function(subset) { for (var elem of subset) { if (!this.has(elem)) { return false; } } return true; } Set.prototype.union = function(setB) { var union = new Set(this); for (var elem of setB) { union.add(elem); } return union; } Set.prototype.intersection = function(setB) { var intersection = new Set(); for (var elem of setB) { if (this.has(elem)) { intersection.add(elem); } } return intersection; } Set.prototype.difference = function(setB) { var difference = new Set(this); for (var elem of setB) { difference.delete(elem); } return difference; } Set.prototype.union_update = function(setB) { var union = this; for (var elem of setB) { union.add(elem); } return union; } Set.prototype.intersection_update = function(setB) { var intersection = this for (var elem of setB) { if (!this.has(elem)) { intersection.delete(elem); } } return intersection; } Set.prototype.difference_update = function(setB) { var difference = this; for (var elem of setB) { difference.delete(elem); } return difference; } /* Set.prototype.symDifference = function(setB) { var difference = new Set(this.union(setB)); var intersection = new Set(this.intersection(setB)); for (var elem of intersection) { difference.delete(elem); } return difference; } */ console.log("test")