Loved the article! I was wondering if we can use more combinations in the yield part . I don't know, maybe callbacks? Is it possible?
yield
function* avengersGenerator() { yield "Hulk"; yield greeting yield "Spiderman"; } function greeting() { console.log("Hi, Tuan!") }
I have not tested it yet 😓
yes, we can! You need to any function there ;)
function greeting() { console.log("Hi, Antonio!") } function* avengersGenerator() { yield "Hulk"; yield greeting() yield "Spiderman"; }
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.
Loved the article! I was wondering if we can use more combinations in the
yield
part . I don't know, maybe callbacks? Is it possible?I have not tested it yet 😓
yes, we can! You need to any function there ;)