Test whether a given value is iterable. An iterable is any value that
implements the Symbol.iterator method, allowing it to be used in a
for...of loop or with the spread operator. Strings qualify alongside
arrays, Map, Set, typed arrays, and generator objects.
Parameters
value: unknown
The value to test for iterability.
Returns valueisIterable<unknown,any,any>
true when the value is iterable; false otherwise. As a type
guard, a true result narrows value to Iterable<unknown>, so it can be
spread or driven with for...of without a cast.
Test whether a given value is iterable. An iterable is any value that implements the
Symbol.iteratormethod, allowing it to be used in afor...ofloop or with the spread operator. Strings qualify alongside arrays,Map,Set, typed arrays, and generator objects.