Skip to content

isIterable

Check if value is iterable.

Usage

js
import { isIterable } from 'js-cool'

Signature

typescript
function isIterable(value: any): boolean

Parameters

ParameterTypeDescription
valueanyValue to check

Returns

boolean - true if value is iterable.

Examples

js
isIterable([1, 2, 3]) // true
isIterable('hello') // true
isIterable(new Set()) // true
isIterable({}) // false
isIterable(null) // false

Released under the MIT License.