3 ms·
Promises and generators were ES6, so around the same time. Although people were using promises long before it became an official feature in ES6. I remember usin
by tchaffee 7y ago
Promises and generators were ES6, so around the same time. Although people were using promises long before it became an official feature in ES6. I remember using promises as far back as 2012 or earlier - jquery had them. ES6 was 2015.
Await and async came after in ES7 and can be considered to use yield[1]. So there you go - that's a perfect example of the power of generators. Promises used to be more difficult until they were simplified using generators.
[1] https://stackoverflow.com/questions/36196608/difference-between-async-await-and-es6-yield-with-generators https://stackoverflow.com/questions/36196608/difference-betw...