-

ary - other_ary รข new_ary
Instance Public methods

Array Difference

Returns a new array that is a copy of the original array, removing any items that also appear in other_ary. The order is preserved from the original array.

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

[ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ]  #=>  [ 3, 3, 5 ]

If you need set-like behavior, see the library class Set.

doc_ruby_on_rails
2015-03-30 14:51:12
Comments
Leave a Comment

Please login to continue.