Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IteratorWithOperators

Hierarchy

  • IteratorWithOperators

Index

Constructors

constructor

  • Parameters

    • source: any

      Iterator to wrap

    Returns IteratorWithOperators

Methods

[Symbol.iterator]

  • [Symbol.iterator](): this
  • The presence of this method makes the Iterator itself Iterable. This makes it possible to pass it to for of and Iterable-accepting functions like Array.from()

    Returns this

concat

  • Returns a new Iterator concatenating the Iterator with an additional Iterator or Iterable

    Parameters

    • collection: any

    Returns IteratorWithOperators

drop

  • Returns a new Iterator that emits slice of the source with n elements dropped from the beginning

    Parameters

    • n: any

      The number of elements to drop.

    Returns IteratorWithOperators

every

  • every(predicate: any): boolean
  • Iterates and checks if predicate returns truthy for all elements emitted by the Iterator

    Parameters

    • predicate: any

    Returns boolean

filter

  • Parameters

    • predicate: any

    Returns IteratorWithOperators

find

  • find(predicate: any): any
  • Parameters

    • predicate: any

    Returns any

flatten

  • Returns a new Iterator that flattens items emitted by the Iterator a single level deep

    Returns IteratorWithOperators

forEach

  • forEach(iteratee: any): void
  • Iterates and invokes iteratee for every element emitted by the Iterator

    Parameters

    • iteratee: any

    Returns void

includes

  • includes(value: any): boolean
  • Iterates and checks if value is emitted by the Iterator

    Parameters

    • value: any

      The value to search

    Returns boolean

join

  • join(separator?: string): string
  • Iterates and joins all elements emitted by the Iterator together as a string separated by an optional separator

    Parameters

    • Default value separator: string = ","

    Returns string

map

  • Returns a new Iterator by running each element thru iteratee

    Parameters

    • iteratee: any

    Returns IteratorWithOperators

next

  • next(): any
  • Returns a { value, done } object that adheres to the Iterator protocol

    Returns any

reduce

  • reduce(iteratee: any, accumulator: any): any
  • Parameters

    • iteratee: any
    • accumulator: any

    Returns any

slice

  • Returns a new Iterator that emits a slice of the source

    Parameters

    • start: number

      Zero-based positive start index, inclusive

    • Default value end: number = Infinity

      Zero-based positive end index, exclusive, defaults to end of iterator

    Returns IteratorWithOperators

some

  • some(predicate: any): boolean
  • Iterates and checks if predicate returns truthy for any element emitted by the Iterator

    Parameters

    • predicate: any

    Returns boolean

take

  • Returns a new Iterator that emits slice of the source with n elements taken from the beginning

    Parameters

    • limit: any

      The number of elements to take.

    Returns IteratorWithOperators

toArray

  • toArray(): any[]
  • Iterates and returns all items emitted by the Iterator as an array. Equivalent to passing the Iterator to Array.from()

    Returns any[]

toMap

  • toMap(): Map<any, any>
  • Iterates and returns all [key, value] paris emitted by the Iterator as an ES6 Map. Equivalent to passing the Iterator to new Map()

    Returns Map<any, any>

toSet

  • toSet(): Set<any>
  • Iterates and returns all items emitted by the Iterator as an ES6 Set. Equivalent to passing the Iterator to new Set()

    Returns Set<any>

Generated using TypeDoc