What is the result of calling a generator function without using the returned iterator?

JavaScript Developer Medium

JavaScript Developer — Medium

What is the result of calling a generator function without using the returned iterator?

Key points

  • Generator functions are lazy; they do not execute immediately
  • .next() method is used to control the execution of a generator function
  • Calling a generator function returns an iterator object
  • Yield statements are used to pause and resume execution

Ready to go further?

Related questions