Skip to content

Instantly share code, notes, and snippets.

@imoss
Last active February 9, 2021 23:56
Show Gist options
  • Save imoss/2c496d590b4ce4849ca91b2b4b8bb32c to your computer and use it in GitHub Desktop.
Save imoss/2c496d590b4ce4849ca91b2b4b8bb32c to your computer and use it in GitHub Desktop.
class Array
def each
for i in 0...length
yield(self.[](i))
end
self
end
def map
ar = []
for i in 0...length
ar << yield(self.[](i))
end
ar
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment