index multimethod


index(arr:Arr, predicate:Any, start:Int=0, dflt:Any=[]) Source: stdlib.ngs:1919
Find index of first value that satisfies the predicate. TODO: Make it work on anything with each() method. In future, will throw exception if element is not found and default is not provided. Now returns null for backwards compatibilty in this case.


arrItems to look at
predicateTest function
startIndex to start search at
dfltdefault value to return when element is not found


Int or dflt. Temporary also null, for backwards compatibilty.


[1,2,11,3,4].index(X>10)  # 2