The yield keyword is similar to the return keyword wherein it returns a value from the function. The difference between them is that the return keyword exits the function, while the yield, pauses the function.
A function with a yield statement can be called a Generator. Generators are paused when the yield
keyword is used. To resume these functions we call them using next()
.