Logo

Programming-Idioms

History of Idiom 218 > diff from v3 to v4

Edit summary for version 4 by steenslag:
[Ruby] Added doc url

Version 3

2020-01-09, 16:30:30

Version 4

2020-01-09, 16:33:14

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Extra Keywords
intersect and conjunction
Extra Keywords
intersect and conjunction
Code
c = a & b
Code
c = a & b
Doc URL
https://ruby-doc.org/core-2.7.0/Array.html#method-i-26
Demo URL
https://ideone.com/bZ3rvD
Demo URL
https://ideone.com/bZ3rvD