Closed Bug 847355 Opened 11 years ago Closed 6 months ago

Add intersections and unions to Set (and Map)

Categories

(Core :: JavaScript Engine, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1805038

People

(Reporter: aleth, Unassigned)

Details

It would be useful to be able to form the intersection and the union of two Sets.

The union would be similar to Array.concat, while an intersection is similar to a particular Array.filter (so it may also make sense to have filter for Sets instead).

I don't know if this has been proposed already, but it is not part of the Harmony specs (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets).
As these methods don't seem to be part of any proposal yet, you should propose them on the es-discuss mailing list.
Why only intersections and unions? How about complements and other set operations?
(In reply to Till Schneidereit [:till] from comment #1)
> As these methods don't seem to be part of any proposal yet, you should
> propose them on the es-discuss mailing list.

For future reference, I proposed this on es-discuss in this thread https://mail.mozilla.org/pipermail/es-discuss/2013-March/028963.html. Some favourable discussion followed, which as far as I know didn't get taken up in a proposal however.
Assignee: general → nobody
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 6 months ago
Duplicate of bug: 1805038
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.