Yields elements from array that match a given predicate, and moreover are between
the given startIndex (inclusive) and endIndex (exclusive).
While this can be done with in the in-built array.filter function, it will
needlessly iterate through the whole array. It also avoids another alternative
of slicing the array before using filter.
Yields elements from
array
that match a givenpredicate
, and moreover are between the givenstartIndex
(inclusive) andendIndex
(exclusive).While this can be done with in the in-built
array.filter
function, it will needlessly iterate through the whole array. It also avoids another alternative of slicing the array before usingfilter
.