Get the min and max with minmax : minmax « Range « Ruby






Get the min and max with minmax

(1..100).minmax                   # => [1,100] min, max as numbers

 

Related examples in the same category