If we pass in a value to be used before the first yield
and at the same time use the yield
keyword to access values passed in, we can never access the first value that is passed in.
⇒ The first time you call
Iterator.prototype.next(value)
value
goes straight to/dev/null
!
next
once just to get the generator started, without using the return value.next
, but as an argument to the Generator Function call itself.
myIterator.return("forced-return-value")
finally
blockyield*
, you can delegate to another generator (stuff like "throw" will control the inner generator until it is done!)(talk to me)