B Seven B Seven - 2 years ago 104
Ruby Question

What is the opposite of Array#reject in ruby?

Is seems that it might be


If so, why isn't it called

Answer Source
  • 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)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download