Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FilterIterator<T>

An iterator which yields values which pass a test.

Type parameters

  • T

Hierarchy

  • FilterIterator

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Construct a new filter iterator.

    Parameters

    • source: IIterator<T>

      The iterator of values of interest.

    • fn: function

      The predicate function to invoke for each value.

        • (value: T, index: number): boolean
        • Parameters

          • value: T
          • index: number

          Returns boolean

    Returns FilterIterator

Properties

Private _fn

_fn: function

Type declaration

    • (value: T, index: number): boolean
    • Parameters

      • value: T
      • index: number

      Returns boolean

Private _index

_index: number = 0

Private _source

_source: IIterator<T>

Methods

clone

iter

next

  • next(): T | undefined
  • Get the next value from the iterator.

    Returns T | undefined

    The next value from the iterator, or undefined.

Generated using TypeDoc