enum.min_by { |obj| block } â obj
enum.min_by â an_enumerator
enum.min_by â an_enumerator
Instance Public methods
Returns the object in enum that gives the minimum value from the given block.
If no block is given, an enumerator is returned instead.
1 2 | a = %w(albatross dog horse) a.min_by { |x| x.length } #=> "dog" |
Please login to continue.