4 ms·
They were introduced when JS went through its "let's copy python" phase. They're kind of crippled because generators only really become useful if you have the
by qsort 4y ago
They were introduced when JS went through its "let's copy python" phase.
They're kind of crippled because generators only really become useful if you have the equivalent of itertools to build a sort of iterator algebra. I love generator-based code in python but it's hard to replicate that without having the library too.
- WorldMaker 4y agoThat's a call out in the article, too. There's a Stage 2 proposal before TC-39 to add a bunch of useful library functions out of the box to the language. In the mean time there's an itertools.js "port" and also IxJS which mirrors RxJS (and .NET LINQ). (I've used IxJS to good effect in JS apps.)