This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use inner_array for index | |
mapped_array = array.inject([]){|inner_array, value| inner_array << map_op(value, inner_array.size)} | |
#as long as each iteration pushes one item on to the inner_array | |