time-to-botec/squiggle/node_modules/@stdlib/assert/is-iterable-like/docs/repl.txt

39 lines
937 B
Plaintext
Raw Normal View History

{{alias}}( value )
Tests if a value is iterable-like.
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
-------
bool: boolean
Boolean indicating whether value is iterable-like.
Examples
--------
> var bool = {{alias}}( [ 1, 2, 3 ] )
<boolean>
> bool = {{alias}}( {} )
false
> bool = {{alias}}( null )
false
See Also
--------