FilterIndexedIterator Reference
A FilterIndexedIterator removes items from the iterator. It inherits from Iterator.
Constructor
Section titled “Constructor”Creates an iterator to remove items from an iterator.
var iterator = ArrayIterator([0, 1, 2]);var filter_iterator = FilterIndexedIterator(iterator, (i, value) -> (i + value) % 2 == 0);Parameters
Section titled “Parameters”iterator: Iterator - The iterator to filter.
predicate: (Number, dyn!) -> Boolean - The predicate function where the first parameter is the index, and the second parameter is the element of the array.
Methods
Section titled “Methods”Inherited
Section titled “Inherited”All methods are inherited from the Iterator class. See the Iterator reference for documentation.
Example
Section titled “Example”var iterator = ArrayIterator([0, 1, 2]);FilterIndexedIterator(iterator, (i, value) -> (i + value) % 2 == 0);// 0// 1// 2