indexes multimethod
Methods
- indexes(arr:Arr, predicate:Any) Source: stdlib.ngs:1799
Find all indexes of values that satisfy the predicate TODO: Make it work on anything with each() method Parameters
arr Items to look at predicate Test function Returns
Arr of IntExample
[1,5,1,10].indexes(X>2) # [1,3]
- indexes(arr:Arr, r:PredRange) Source: stdlib.ngs:1929
Find the indexes of elements of the given PredRange. Throws IndexNotFound if there is no match between the elements of arr and r. Returns
NumRange with .include_start=true and .include_end=falseExample
%[a1 a2 b1 b2 c1].indexes(/^a/../^b/) # <NumRange 1..2 include_start=true include_end=false step=1> %[a1 a2 b1 b2 c1].indexes(/^a/.../^b/) # <NumRange 0..3 include_start=true include_end=false step=1>