Generator
object is returned by a generator function and it conforms to both the iterable protocol and the iterator protocol.next
()
method returns an object with two properties done
and value
. You can also provide a parameter to the next
method to send a value to the generator.return()
method returns the given value and finishes the generator.throw()
method resumes the execution of a generator by throwing an error into it and returns an object with two properties done
and value
.