B Seven B Seven - 11 months ago 64
Ruby Question

What is the opposite of Array#reject in ruby?

Is seems that it might be


If so, why isn't it called

  • The opposite of reject is select (returning a new array)
  • The opposite of reject! is select! (editing the array in place)
  • The opposite of keep_if is delete_if (editing the array in place)