Is there any Array or Enumerable built-in that allows me to search for an element using a block, and return its index?
Something along the lines of :
ar = [15,2,33,4,50,69]
indexes = ar.find_indexes {|item| item > 4 == 0}
# indexes will now contain 0,2,4,5
It would be very easy to add my own, but I'd like to know if this already exists?