Letting RegExp method return something iterable?

Andrea Giammarchi andrea.giammarchi at gmail.com
Wed Aug 28 14:41:27 PDT 2013


On Wed, Aug 28, 2013 at 2:12 AM, Forbes Lindesay <forbes at lindesay.co.uk>wrote:

>  a simple way to loop over the list of matches for a regular expression


it's about 10 years or more we have that .. so to make my very personal
statement clear:

I've got 99 problems in JS, make everything an iterator ain't one

Specially when the need comes out of an example and code that does not
fully understand or use what's available since ever in JS, specially for
something that has never been a real-world problem (but please tell me how
better your app would have been otherwise)

`for(let m of lazySplit('a.b.c', /\./g))` taking my example and prioritize
something else since generators give already us the ability to do that? ^_^

Or maybe not, fine for me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130828/da9a28c6/attachment.html>


More information about the es-discuss mailing list