Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ArrayTools

Class containing a set of static utilities functions for arrays.

Hierarchy

  • ArrayTools

Index

Methods

Static BuildArraySearch playground for BuildArray

  • BuildArray<T>(size: number, itemBuilder: () => T): Array<T>
  • Returns an array of the given size filled with elements built from the given constructor and the parameters.

    Type parameters

    • T

    Parameters

    • size: number

      the number of element to construct and put in the array.

    • itemBuilder: () => T

      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.

Static BuildTupleSearch playground for BuildTuple

  • BuildTuple<T, N>(size: N, itemBuilder: () => T): TupleTypes<T>[N]
  • Returns a tuple of the given size filled with elements built from the given constructor and the parameters.

    Type parameters

    • T

    • N: keyof TupleTypes<unknown>

    Parameters

    • size: N

      he number of element to construct and put in the tuple.

    • itemBuilder: () => T

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

        • (): T
        • Returns T

    Returns TupleTypes<T>[N]

    a new tuple filled with new objects.

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method