ArrayTools

Class containing a set of static utilities functions for arrays.

Hierarchy

  • ArrayTools

Index

Methods

Methods

Static BuildArray

Find examples in Playground
  • BuildArray<T>(size: number, itemBuilder: function): Array<T>
  • Returns an array of the given size filled with element built from the given constructor and the paramters

    Type parameters

    • T

    Parameters

    • size: number

      the number of element to construct and put in the array

    • itemBuilder: function

      a callback responsible for creating new instance of item. Called once per array entry.

        • (): T
        • Returns T

    Returns Array<T>

    a new array filled with new objects

Generated using TypeDoc