Skip to main content

CommonFilterMap

Callable

  • CommonFilterMap<Tinp, Tout>(array, predicateMapper, thisArg): Tout[]

  • Take an array and find all element that map to a user-specified value, returning the mapped value.

    Effectively combines array.filter and array.map.


    Parameters

    • array: readonly Tinp[]

      The array in question

    • predicateMapper: (value, index, obj) => Tout

      A mapping predicate. All non-nullish return value will be returned by the outer function.

      • optionalthisArg: any = null

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Tout[]

      • All successfully mapped value