sort / reverse / each
Sorting and iteration.
Syntax
arr.sort · arr.each { |e| ... }Description
sort sorts, reverse reverses (new arr). each runs a block for each element.
Example
Loading editor…
Expected output
[1, 2, 3] al mor
When to use?
Sorting, traversing lists.