isIterable es-toolkit
Checks if a value is iterable.
Usage
isIterable(value)
Use isIterable to check whether a value implements the iterable protocol — that is, whether it has a Symbol.iterator method. Arrays, strings, Set, Map, typed arrays, and generators are iterable; plain objects, null, and undefined are not.
It can also be used as a type guard in TypeScript.
Parameters
valueunknownrequired
The value to check.
Returns
Returns true if the value is iterable, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.