Skip to content

Instantly share code, notes, and snippets.

@pointcom
Created January 8, 2018 14:50
Show Gist options
  • Save pointcom/ccecd229d55c8d55ed4683129d7e09aa to your computer and use it in GitHub Desktop.
Save pointcom/ccecd229d55c8d55ed4683129d7e09aa to your computer and use it in GitHub Desktop.
# http://ruby-doc.org/core-2.5.0/Enumerable.html#method-i-min
# Ruby 2.2
[1, 2, 3, 4, 5].min(2)
=> [1, 2]
[3, 4, 5].max(3)
=> [5, 4, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment