JS: IteratorResult Interface
IteratorResult Interface is required as return value in Iterator Interface .
IteratorResult Interface Properties
done-
trueorfalse- This is the result status of an iterator next method call.
- If the end of the iterator was reached,
doneistrue. - If the end was not reached,
doneisfalseand avalueproperty is available. - If a
doneproperty (either own or inherited) does not exist, it is consider to have the valuefalse.
"value"-
Any JavaScript value.
- If
doneisfalse, this is the current iteration element value. - If
doneistrue, this is the return value of the iterator, if it supplied one. - If the iterator does not have a return value, value is undefined.
- In that case, the value property may be absent from the conforming object if it does not inherit an explicit value property.
- If
JavaScript. Iterable, Iterator
- JS: Iterable Object
- JS: for-of Loop
- JS: Array.from
- JS: Spread Operator (triple dots)
- JS: Iterator
- JS: Iterator.prototype
- JS: Generator
- JS: Generator Function (asterisk)
- JS: Interface
- JS: Iterable Interface
- JS: Iterator Interface
- JS: IteratorResult Interface
- JS: Test If Object is Iterable or Iterator 📜