Check out example codes for "how to find even number in an array ruby". It will help you in understanding the concepts better.

Code Example 1

my_array = [1, 2, 3, 4, 5, 6]
my_array.select{ |number| number.even?}
#OR
my_array.select{ |number| number % 2 == 0}
#OR 
my_array.find_all{ |number| number.even?}

Learn ReactJs, React Native from akashmittal.com