Options
All
  • Public
  • Public/Protected
  • All
Menu

Module iterable/filter

Index

References

Functions

References

Renames and re-exports filter

Functions

  • filter<T, R>(predicate: (t: T) => t is R, iterable: Iterable<T>): Iterable<R>
  • filter<T>(predicate: (t: T) => boolean, iterable: Iterable<T>): Iterable<T>
  • filter<T, R>(predicate: (t: T) => t is R): (iterable: Iterable<T>) => Iterable<R>
  • filter<T>(predicate: (t: T) => boolean): (iterable: Iterable<T>) => Iterable<T>
  • Takes a predicate and a "iterable", and returns a new iterable of the same type containing the members of the given iterable which satisfy the given predicate.

    example
     filter(n => n % 2 === 0, [1, 2, 3, 4]);     //=> Iterable<[2, 4]>
    

    Type parameters

    • T

    • R

    Parameters

    • predicate: (t: T) => t is R

      The predicate function

        • (t: T): t is R
        • Parameters

          • t: T

          Returns t is R

    • iterable: Iterable<T>

      The iterable target to filter

    Returns Iterable<R>

  • Takes a predicate and a "iterable", and returns a new iterable of the same type containing the members of the given iterable which satisfy the given predicate.

    example
     filter(n => n % 2 === 0, [1, 2, 3, 4]);     //=> Iterable<[2, 4]>
    

    Type parameters

    • T

    Parameters

    • predicate: (t: T) => boolean

      The predicate function

        • (t: T): boolean
        • Parameters

          • t: T

          Returns boolean

    • iterable: Iterable<T>

      The iterable target to filter

    Returns Iterable<T>

  • Takes a predicate and a "iterable", and returns a new iterable of the same type containing the members of the given iterable which satisfy the given predicate.

    example
     filter(n => n % 2 === 0, [1, 2, 3, 4]);     //=> Iterable<[2, 4]>
    

    Type parameters

    • T

    • R

    Parameters

    • predicate: (t: T) => t is R

      The predicate function

        • (t: T): t is R
        • Parameters

          • t: T

          Returns t is R

    Returns (iterable: Iterable<T>) => Iterable<R>

      • (iterable: Iterable<T>): Iterable<R>
      • Parameters

        • iterable: Iterable<T>

        Returns Iterable<R>

  • Takes a predicate and a "iterable", and returns a new iterable of the same type containing the members of the given iterable which satisfy the given predicate.

    example
     filter(n => n % 2 === 0, [1, 2, 3, 4]);     //=> Iterable<[2, 4]>
    

    Type parameters

    • T

    Parameters

    • predicate: (t: T) => boolean

      The predicate function

        • (t: T): boolean
        • Parameters

          • t: T

          Returns boolean

    Returns (iterable: Iterable<T>) => Iterable<T>

      • (iterable: Iterable<T>): Iterable<T>
      • Parameters

        • iterable: Iterable<T>

        Returns Iterable<T>

Generated using TypeDoc