Filter
Select certain elements from an Array into a new Array in a generic way. E.g., select all even numbers from an Array
Filter
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
Ruby
ary = [1,2,3,4,5,6] even_ary = ary.select{|el|el%2==0} # => [2, 4, 6]