Array.indexOf with block