Converts most objects that can be an Iterator into one. The supported inputs are:
An Iterator, will return the input as is/unchanged.
An Iterable, will return the input with it's Symbol.iterator property called. So this includes any object that
has a Symbol.iterator property. Like Arrays, Strings, Maps, Sets, etc.
Any function with an optional sentinel argument, will return a FunctionIterator. This iterator will call the
input func once per next() call and will stop once the value of sentinel (default: undefined) is returned from
func.
Any other non-nullable object, will return an ObjectIterator that iterates over the input object's own properties
deeply.
Converts most objects that can be an
Iterator
into one. The supported inputs are:Iterator
, will return the input as is/unchanged.Iterable
, will return the input with it'sSymbol.iterator
property called. So this includes any object that has aSymbol.iterator
property. Like Arrays, Strings, Maps, Sets, etc.function
with an optionalsentinel
argument, will return aFunctionIterator
. This iterator will call the inputfunc
once pernext()
call and will stop once the value ofsentinel
(default: undefined) is returned fromfunc
.