Hex Core JS
    Preparing search index...

    Function filterMap

    • Creates a new array by first filtering and then transforming elements in the given array. Is an optimized form of array.filter().map(), which iterates over the given array two times. For the reverse order of operations, use mapFilter.

      Type Parameters

      • T
      • F
      • M

      Parameters

      • array: T[]

        The array to filter and map.

      • filter: (value: T, index: number, array: T[]) => value is F

        The filter function to select elements for the new array.

      • map: (value: F, index: number, array: T[]) => M

        The transform function from elements in the original array to elements in the resuling array.

      Returns M[]

    • Creates a new array by first filtering and then transforming elements in the given array. Is an optimized form of array.filter().map(), which iterates over the given array two times. For the reverse order of operations, use mapFilter.

      Type Parameters

      • T
      • M

      Parameters

      • array: T[]

        The array to filter and map.

      • filter: (value: T, index: number, array: T[]) => boolean

        The filter function to select elements for the new array.

      • map: (value: T, index: number, array: T[]) => M

        The transform function from elements in the original array to elements in the resuling array.

      Returns M[]