I think the ergonomics of generators is growing on me.
Briefly

The article discusses the recent syntactic additions to JavaScript, emphasizing features like arrow functions and template literals that solve common coding problems. The author highlights generator functions as a lesser-known feature from ES2015, admitting their practical use is not as widespread. By diving deeper into the iterator and iterable protocols, the article attempts to unravel the potential benefits of generators, sharing personal insights and gradually developing an appreciation for their ergonomic advantages in specific scenarios.
The new JavaScript syntactic sugar introduced in recent years, like arrow functions and template literals, addresses many real pain points, enhancing programming efficiency.
While generator functions are less recognized than other ES2015 features, they present unique ergonomic benefits and a powerful mental model for JavaScript developers.
Generators depend on the iterator and iterable protocols, which standardize how objects return sequences, thus enriching the language's handling of potentially infinite data.
Despite their quirks, my intentional exploration of generators has led to a newfound appreciation for their capabilities, especially in handling sequences of values.
Read at Alex MacArthur
[
|
]