u0_omg
Last Updated: February 25, 2016
·
933
· mcansky

fast comparison

You need to get the smaller of two or more numbers ?

Ruby has a method for that :

[3,7,5].min

Yes it's so simple that you wonder why I write a protip for that. Well if nobody has told you or shown you that, you might not think of it on your own ...

1 Response
Add your response

1907

Interestingly enough .sum method is only available in ActiveSupport

over 1 year ago ·