Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ArrayLikeIterable<T>

An iterable with array-like iteration operations. Both Array and AIterable implement it.

Type parameters

  • T

    A type of elements.

Hierarchy

Implemented by

Index

Methods

[Symbol.iterator]

  • [Symbol.iterator](): Iterator<T>

every

  • every(test: (this: void, value: T) => boolean): boolean
  • Determines whether all elements in this iterable satisfy the specified test.

    Parameters

    • test: (this: void, value: T) => boolean

      A function that accepts an element as its only parameter. The every method calls the test function for each element until the true returns false, or until the end of iterable.

        • (this: void, value: T): boolean
        • Parameters

          • this: void
          • value: T

          Returns boolean

    Returns boolean

filter

  • Returns the elements of this iterable that meet the condition specified in a callback function.

    Type parameters

    • S: T

    Parameters

    • test: (this: void, value: T) => value is S

      A function that accepts an element as its only parameter. The filter method calls the test function one time for each element.

        • (this: void, value: T): value is S
        • Parameters

          • this: void
          • value: T

          Returns value is S

    Returns ArrayLikeIterable<S>

  • Returns the elements of this iterable that meet the condition specified in a callback function.

    Parameters

    • test: (this: void, value: T) => boolean

      A function that accepts an element as its only parameter. The filter method calls the test function one time for each element.

        • (this: void, value: T): boolean
        • Parameters

          • this: void
          • value: T

          Returns boolean

    Returns ArrayLikeIterable<T>

flatMap

  • Calls a defined callback function on each element in this iterable. Then, flattens the result.

    Type parameters

    • U

    Parameters

    • map: (this: void, value: T) => ReadonlyArray<U>

      A function that accepts an element as its only parameter. The flatMap method calls the map function one time for each element.

        • (this: void, value: T): ReadonlyArray<U>
        • Parameters

          • this: void
          • value: T

          Returns ReadonlyArray<U>

    Returns ArrayLikeIterable<U>

forEach

  • forEach(action: (this: void, value: T) => void): void
  • Performs the specified action for each element in this iterable.

    Parameters

    • action: (this: void, value: T) => void

      A function that accepts an element as its only parameter. The forEach method calls the action function one time for each element.

        • (this: void, value: T): void
        • Parameters

          • this: void
          • value: T

          Returns void

    Returns void

map

  • Calls a defined callback function on each element in this iterable, and returns an iterable that contains the results.

    Type parameters

    • U

    Parameters

    • map: (this: void, value: T) => U

      A function that an element as its only parameter. The map method calls the map function one time for each element.

        • (this: void, value: T): U
        • Parameters

          • this: void
          • value: T

          Returns U

    Returns ArrayLikeIterable<U>

reduce

  • reduce<U>(reducer: (this: void, previousValue: U, currentValue: T) => U, initialValue: U): U
  • Calls the specified callback function for all the elements in this iterable. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Type parameters

    • U

    Parameters

    • reducer: (this: void, previousValue: U, currentValue: T) => U

      A function that accepts an accumulated value and an element as its parameters. The reduce method calls the reducer function one time for each element.

        • (this: void, previousValue: U, currentValue: T): U
        • Parameters

          • this: void
          • previousValue: U
          • currentValue: T

          Returns U

    • initialValue: U

      Used as the initial value to start the accumulation. The first call to the reducer function provides this value as the first parameter.

    Returns U

reverse

some

  • some(test: (this: void, value: T) => boolean): boolean
  • Determines whether some element in this iterable satisfies the specified test.

    Parameters

    • test: (this: void, value: T) => boolean

      A function that accepts an element as its only parameter. The some method calls the test function for each element until the test returns true, or until the end of iterable.

        • (this: void, value: T): boolean
        • Parameters

          • this: void
          • value: T

          Returns boolean

    Returns boolean

Generated using TypeDoc