Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Array<T>

Extends the built-in javascript Array object's prototype.

The Format.Config.addUtilsToPrototype method must be called in order to access the definitions.

Type parameters

  • T

    The type of elements in the array.

Hierarchy

  • Array

Index

Methods

Methods

compact

  • compact(): T[]

takeWhile

  • takeWhile(predicate: function): T[]
  • Returns elements from a sequence as long as the specified condition is true.

    Must call Format.Config.addUtilsToPrototype to be defined.

    Parameters

    • predicate: function

      A function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (item: T, index?: number): boolean
        • Parameters

          • item: T

            A source element that is tested for a condition.

          • Optional index: number

            The index of the source element.

          Returns boolean

    Returns T[]

    A new array instance containing only items for which the predicate function returned true.

Generated using TypeDoc