In JavaScript, generators are a special type of function that can be paused and resumed at specific points during its execution, allowing for the creation of iterable sequences of values.
Generators are defined using the function* syntax, and they use the yield keyword to define points at which the generator