https://medium.com/@Marioskif/javascript-daily-tips-22-the-magic-of-javascript-generators-f5ebf838d46f