Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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-betw...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: