re: Understanding Generators in ES6 Javascript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: 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? function* ...
 

yes, we can! You need to any function there ;)

function greeting() {
  console.log("Hi, Antonio!")
}

function* avengersGenerator() {
  yield "Hulk";
  yield greeting()
  yield "Spiderman";
}


code of conduct - report abuse