@mirei/ts-collections
    Preparing search index...

    Function toArray

    • Materialises source into an array.

      Type Parameters

      • TElement

        Type of elements within source.

      Parameters

      • source: Iterable<TElement>

        The source iterable.

      Returns TElement[]

      An array containing all elements from source in iteration order.

      The entire sequence is enumerated immediately. Subsequent changes to source are not reflected in the returned array.

      const numbers = [1, 2, 3];
      const array = toArray(numbers);
      console.log(array); // [1, 2, 3]