• Creates a new, shallow-copied array instance containing elements of the source iterable.

    Calling this function result to the same result as calling Array.from(source), except it is optimized for push iterables.

    Type Parameters

    • T

      Iterated elements type.

    Parameters

    • source: Iterable<T>

      A source iterable to copy elements from.

    Returns T[]

    New array of source elements.

  • Creates a new, shallow-copied array instance containing elements of the source iterable converted by the given converter function.

    Calling this function result to the same result as calling Array.from(source, convert), except it is optimized for push iterables.

    Type Parameters

    • T

      Iterated elements type.

    • TConv

      Resulting array elements type.

    Parameters

    • source: Iterable<T>

      A source iterable to convert elements from.

    • convert: ((this, element) => TConv)

      A function that produces an element of result array, taking element of source iterable as the only parameter.

        • (this, element): TConv
        • Parameters

          • this: void
          • element: T

          Returns TConv

    Returns TConv[]

    New array of elements converted from source ones.

Generated using TypeDoc