0

I have 2 arrays :

arr1 = [1,2,3,4]
arr2 = [1,2, 82, 167,3,79,4]

I want to implement a function that realize the following

new_elems(arr1, arr2)
#=> [82,167,79]

Is there a ruby function for this?

Thank you

EDIT:

Array#- would answer to this question. What about the performances then ? Let's say I have a thousands elements array. Would Array#- have acceptable performances ?

user3442206
  • 577
  • 1
  • 6
  • 22

0 Answers0