Function: empty()
empty<
ElementType
>():IterableIterator
<ElementType
>
Creates an empty iterator.
Type Parameters
Type Parameter | Default type |
---|---|
ElementType | never |
Returns
IterableIterator
<ElementType
>
An empty iterator.
Example
import { empty } from '@sapphire/iterator-utilities';
const iterable = empty();
console.log([...iterable]);
// Output: []
Defined in
projects/utilities/packages/iterator-utilities/src/lib/empty.ts:17