Hey lionel, thanks for the great feedback. The idea of using generators looks really interesting. I'll look into it and maybe do a follow up article on Generators.
What you get with a generator function is basically what you hand-rolled with return { value, done }:
return { value, done }
const gen = (function*() { yield 1 })() // Object [Generator] {} gen.next() // { value: 1, done: false } gen.next() // { value: undefined, done: true }
They're pretty nifty 😊
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey lionel, thanks for the great feedback.
The idea of using generators looks really interesting. I'll look into it and maybe do a follow up article on Generators.
What you get with a generator function is basically what you hand-rolled with
return { value, done }
:They're pretty nifty 😊