What happens when promise is yielded in javascript?
As Felix says, a promise is just another value to be yielded. However, there is a style of writing asynchronous code which makes use of yielded promises in a particular way. This involves a surrounding piece of code which invokes the generator, then waits for the yielded promise to resolve, and then and only then … Read more