Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Array
- def map_with_index
- mapping = []
- each_with_index do |e,i|
- mapping << yield(e,i)
- end
- mapping
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement