Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-iterable-like/docs/types/index.d"

Index

Functions

Functions

Export assignment isIterableLike

  • isIterableLike(value: any): boolean
  • Tests if a value is iterable-like.

    Notes

    • In order to be iterable, an object must implement the @@iterator method, which, when called, returns an iterator protocol-compliant object.
    • An iterator protocol-compliant object is an object having a next method which adheres to the iterator protocol.
    • As full iterator compliance is impossible to achieve without evaluating an iterator, this function checks only for interface compliance.
    • In environments lacking Symbol.iterator support, this function always returns false.

    Parameters

    • value: any

      value to test

    Returns boolean

    boolean indicating whether a value is iterable-like

    Example

    var bool = isIterableLike( [] );
    // returns <boolean>

    Example

    var bool = isIterableLike( {} );
    // returns false

    Example

    var bool = isIterableLike( null );
    // returns false