Skip to main content

Function: empty()

empty<ElementType>(): IterableIterator<ElementType>

Creates an empty iterator.

Type Parameters

Type ParameterDefault type
ElementTypenever

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