@pleisto/active-support
    Preparing search index...

    Variable selectConst

    select: <T, K>(
        array: readonly T[],
        mapper: (item: T, index: number) => K,
        condition: (item: T, index: number) => boolean,
    ) => K[]

    Select performs a filter and a mapper inside of a reduce, only iterating the list one time.

    Type declaration

      • <T, K>(
            array: readonly T[],
            mapper: (item: T, index: number) => K,
            condition: (item: T, index: number) => boolean,
        ): K[]
      • Type Parameters

        • T
        • K

        Parameters

        • array: readonly T[]
        • mapper: (item: T, index: number) => K
        • condition: (item: T, index: number) => boolean

        Returns K[]

    select([1, 2, 3, 4], x => x*x, x > 2) == [9, 16]