Function stream

  • Returns a Stream that yields the elements of the Iterable parameter.

    Type Parameters

    • T

      Type of items in the Stream.

    Parameters

    • Optionaliterable: Iterable<T>

      Iterable to create the Stream from.

    Returns Stream<T>

    Stream that yields the elements of the Iterable.

    const result = from('ABCD');
    console.log([...result]); // ['A', 'B', 'C', 'D']