Skip to content

Instantly share code, notes, and snippets.

@offby1
Created June 15, 2012 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save offby1/2934502 to your computer and use it in GitHub Desktop.
Save offby1/2934502 to your computer and use it in GitHub Desktop.
def my_reverse(a)
reversed = []
a.each do |element|
reversed.unshift(element)
end
reversed
end
p my_reverse([1, 2, 3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment