Function isIterable

  • Checks if the given object is iterable.

    Type Parameters

    • T

    Parameters

    • o: T

      The object to check.

    Returns boolean

    A boolean indicating whether the object is iterable.

    Remarks

    This function checks if the given object is iterable by checking if the object is not null, is an object, and has a function for the Symbol.iterator property.

    Typeparam

    T - The type of the object to check.

    Example

    isIterable([1, 2, 3]);;
    //=> true
    isIterable(5);;
    //=> false

Generated using TypeDoc