Skip to content

Instantly share code, notes, and snippets.

@polycarpou
Created September 27, 2013 03:42
Show Gist options
  • Save polycarpou/6723828 to your computer and use it in GitHub Desktop.
Save polycarpou/6723828 to your computer and use it in GitHub Desktop.
creating my own each method
def my_each(arr)
count = 0
while count <= arr.length
yield(arr[count])
count += 1
end
end
my_each([1,2,3,4,6]) do |x|
puts x
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment