Mark Volkmann (2015-04-05T13:04:31.000Z)
I thought that when an iterator returns done: true, the value should not be used. However, if a generator function ends by returning a value, done will be true when that value is returned and the value should be used. Given this, how can a consumer know the correct way to handle the value when done is true? Clearly consumers shouldn't have to be aware of whether the iterator is actually a generator and whether it ends by returning a value.

---
R. Mark Volkmann
Object Computing, Inc.
d at domenic.me (2015-04-14T22:23:31.866Z)
I thought that when an iterator returns done: true, the value should not be used. However, if a generator function ends by returning a value, done will be true when that value is returned and the value should be used. Given this, how can a consumer know the correct way to handle the value when done is true? Clearly consumers shouldn't have to be aware of whether the iterator is actually a generator and whether it ends by returning a value.