When a generator function is initially called, it returns a(n) __________ object.

  • Generator
  • Promise
  • Iterator
  • Iterable
When a generator function is called, it returns an iterator object. This object can be used to iterate through the values generated by the generator using the next() method. The other options do not represent the initial return type of a generator function.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *