Home > polyethylene > PolyAsyncIterable > take
Return a new iteration that iterates only over the first num
elements. If there were less than than num
elements in the iteration, all elements are yielded with no additions.
Signature:
take(num: number): PolyAsyncIterable<T>;
Parameter | Type | Description |
---|---|---|
num | number | The number of elements to yield |
Returns:
PolyAsyncIterable<T>
a new PolyAsyncIterable that yields the first num
elements elements of this