Skip to main content

Function: empty()

empty<ElementType>(): IterableIterator<ElementType>

Creates an empty iterator.

Type parameters

Type parameterValue
ElementTypenever

Returns

IterableIterator<ElementType>

An empty iterator.

Example

import { empty } from '@sapphire/iterator-utilities';

const iterable = empty();
console.log([...iterable]);
// Output: []

Source

projects/utilities/packages/iterator-utilities/src/lib/empty.ts:17