Topic
A function can only return a single value. Generators function* helps to return more than one value, one after another, and on-demand in JavaScript.
function*