Array#find_index() : find_index() is a Array class method which returns the index of the first array. If a block is given instead of an argument, returns the index of the first object for which the block returns true.
Syntax: Array.find_index()
Parameter: block - condition to follow
Return: index value of the array elements
Code #1 : Example for find_index() method
Output :
find_index : 4
find_index : 1
find_index : 2
Code #2 : Example for find_index() method
Output :
find_index : 0
find_index : 1
find_index : 1