Skip to content

Instantly share code, notes, and snippets.

@ahimmelstoss
Created October 11, 2013 17:09
Show Gist options
  • Save ahimmelstoss/6938438 to your computer and use it in GitHub Desktop.
Save ahimmelstoss/6938438 to your computer and use it in GitHub Desktop.
def my_each(array)
i = 0
while i < array.length
raise (yield(array[i])).inspect
i+=1
end
array
end
array = [1, 2, 3]
my_each(array) do |i|
i*i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment