isIterable

isIterable

Check whether the given value is iteratable or not

Import

import { isIterable } from '@fullstacksjs/toolbox';

Signature

function isIterable<T>(x: unknown): x is Iterable<T> {}

Examples

isIterable([])        // true
isIterable(new Map()) // true
isIterable('some')    // true
isIterable({})        // false
isIterable(undefined) // false