VOOZH about

URL: https://www.geeksforgeeks.org/ruby/ruby-enumerable-reverse_each-function/

⇱ Ruby | Enumerable reverse_each() function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Enumerable reverse_each() function

Last Updated : 12 Jul, 2025
The reverse_each() of enumerable is an inbuilt method in Ruby returns the elements of the temporary array. The temporary array contains the enumerable in reverse order. It returns an enumerator if no block is given.
Syntax: enu.reverse_each { |obj| block } Parameters: The function accepts a block. Return Value: It returns the elements in reverse order.
Example 1: Output:
false
true
false
true
false
true
false
true
false
true
Example 2: Output:
Enumerator: [1, 7, 10, 11]:reverse_each
Comment