What does .select do again?



multiples_of_3 = Proc.new do |n|
  n % 3 == 0



.select() is a collection method that maps the values in a range object that meet the criterion specificied by the Proc passed in to it.

multiples_of_3 returns true or false, and select() will map only the values in the range that end up true in return from the proc. The output array will contain only

[3, 6, 9, .., 93, 96, 99]