- :logical
sorted?
check if given collection is already sorted
Parameters
sorted? collection :block
Attributes
descending | check for sorting in ascending order |
Returns
Examples
copysorted? [1 2 3 4 5] ; => true sorted? [4 3 2 1 5] ; => false sorted? [5 4 3 2 1] ; => false
copysorted?.descending [5 4 3 2 1] ; => true sorted?.descending [4 3 2 1 5] ; => false sorted?.descending [1 2 3 4 5] ; => false