@nbogie/p5.neill-utils
    Preparing search index...

    Function collect

    • Builds and returns an array collected from the repeated calling of the given function.

      Type Parameters

      • Item

      Parameters

      • numItems: number

        number of items to collect

      • fn: (ix: number) => Item

        function to call repeatedly in order to construct each element of the array. It will be passed a counter (zero-based) indicating the number of the current iteration.

      Returns Item[]

      array of constructed items