execute
The execute() function fully consumes a generator by iterating over all its elements without returning a value. Used to end a chain of transformations on a generator.
Interactive example
Syntax
Synchronous signature
typescript
function execute<
GenericIterator extends Iterable<unknown>
>(
iterator: GenericIterator
): voidAsynchronous signature
typescript
function execute<
GenericIterator extends AsyncIterable<unknown>
>(
iterator: GenericIterator
): Promise<void>Parameters
iterator: The generator (synchronous or asynchronous) to execute fully.
Return value
void for synchronous generators, Promise<void> for asynchronous generators.
