Creates array of specified length using generator function

  • Type Parameters

    • T

    Parameters

    • n: number

      Length of array

    • f: () => T

      Function to generate each element

    Returns T[]

    Generated array