Reverse `...` method Ruby
ruby
Solution
The easiest is probably this:
4.downto(1).to_a #=> [4, 3, 2, 1]
Alternatively you can use `step`:
4.step(1,-1).to_a #=> [4, 3, 2, 1]
Finally a rather obscure solution for fun:
(-4..-1).map(&:abs) #=> [4, 3, 2, 1]
Problem
Is there a standard method in ruby similar to `(1...4).to_a` is `[1,2,3,4]` except reverse i.e. `(4...1).to_a` would be `[4,3,2,1]`? I realize this can easily be defined via `(1...4).to_a.reverse` but it strikes me as odd that it is not already and 1) am I missing something? 2) if not, is there a functional/practical reason it is not already?