Skip to content

Instantly share code, notes, and snippets.

@mtodd
Created December 16, 2010 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mtodd/743132 to your computer and use it in GitHub Desktop.
Save mtodd/743132 to your computer and use it in GitHub Desktop.
class Array
def recursive_reverse
return self if empty?
[pop, *reverse]
end
end
puts [1,2,3,4].recursive_reverse.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment