Function countMap

Use initializedArray(). countMap was my first attempt at a name and I don't like it!

  • Create and initialize an array.

    Type Parameters

    • T

    Parameters

    • count: number

      The number of items in the array.

    • callback: ((index: number) => T)

      A function which will take the (zero based) array index as an input and will return the value to put into the array at that index.

        • (index): T
        • Parameters

          • index: number

          Returns T

    Returns T[]

    An array containing all of the results.