|

ary | other_ary â new_ary
Instance Public methods

Set Union â Returns a new array by joining ary with other_ary, excluding any duplicates and preserving the order from the original array.

It compares elements using their hash and eql? methods for efficiency.

[ "a", "b", "c" ] | [ "c", "d", "a" ]    #=> [ "a", "b", "c", "d" ]

See also #uniq.

doc_ruby_on_rails
2015-03-30 21:34:08
Comments
Leave a Comment

Please login to continue.