JS: IteratorResult Interface
IteratorResult Interface is required as return value in JS: Iterator Interface .
IteratorResult Interface Properties
done
-
true
orfalse
- This is the result status of an iterator next method call.
- If the end of the iterator was reached,
done
istrue
. - If the end was not reached,
done
isfalse
and avalue
property is available. - If a
done
property (either own or inherited) does not exist, it is consider to have the valuefalse
.
"value"
-
Any JavaScript value.
- If
done
isfalse
, this is the current iteration element value. - If
done
istrue
, 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