Skip to content

Instantly share code, notes, and snippets.

@manleyhimself
Created September 27, 2013 03:51
Show Gist options
  • Save manleyhimself/6723869 to your computer and use it in GitHub Desktop.
Save manleyhimself/6723869 to your computer and use it in GitHub Desktop.
def my_each(array)
i = 0
while i < array.length
yield(array[i])
i += 1
end
end
num_array = [5,6,7,8]
my_each(num_array) do |num|
puts "#{num + 1}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment