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

    Variable iterateConst

    iterate: <T>(
        count: number,
        func: (currentValue: T, iteration: number) => T,
        initValue: T,
    ) => T

    Like a reduce but does not require an array. Only need a number and will iterate the function as many times as specified.

    NOTE: This is NOT zero indexed. If you pass count=5 you will get 1, 2, 3, 4, 5 iteration in the callback function

    Type declaration

      • <T>(
            count: number,
            func: (currentValue: T, iteration: number) => T,
            initValue: T,
        ): T
      • Type Parameters

        • T

        Parameters

        • count: number
        • func: (currentValue: T, iteration: number) => T
        • initValue: T

        Returns T