javascript - Normal callback code vs. generator code example -


i in need of understanding generators can start writing code dealing generators, every guide/tutorial read has been doing no me can still confused why generator functions highly preferred on regular call code.

i looked @ comparison examples on place , still don't know big deal is.... generators can make "asynchronous code synchronous" how "making synchronous" seem ultimate way of writing async flow code?

i have provided screenshot of you-dont-know-js guide , here have provided direct example of post. can't seem wrap head around whats great generator code because seems writing same amount of code regular callbacks , still able understand code without converting normal code generator code.

part 1

part 2

part 3


Comments