Hex Core JS
    Preparing search index...

    Function mapFilter

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

      Type Parameters

      • T
      • M
      • F

      Parameters

      • array: T[]

        The array to filter and map.

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

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

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

        The filter function to select transformed elements for the new array.

      Returns F[]

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

      Type Parameters

      • T
      • M

      Parameters

      • array: T[]

        The array to filter and map.

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

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

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

        The filter function to select transformed elements for the new array.

      Returns M[]