Actions
Misc #12122
closedArray Documentation (set intersection, union)
Status:
Closed
Assignee:
-
Description
Set Intersection
- Most know what intersection means, but saying the operation excludes duplicates could be misleading (
[1] & [1]
, duplicates excluded, might mean a result of[]
). - Instead, saying intersection returns the unique elements common to both arrays is more concise and less ambiguous.
Set Union
- The set union's documentation was incomplete in its describing preservation of order. Saying union preserves the order of the original array neglects the idea that the order of the elements in both arrays, as given, will be preserved.
- Instead, saying set union preserves the order from the given arrays (and adding an example) fully demonstrates the idea.
- Adds an example I think better demonstrates the preservation of order:
[ "c", "d", "a" ] | [ "a", "b", "c" ] #=> [ "c", "d", "a", "b" ]
Actions
Like0
Like0