For what it's worth, that specific use case would be addressed by
https://github.com/tc39/String.prototype.matchAll ;-)

On Wed, Sep 14, 2016 at 4:20 PM, Oriol Bugzilla <oriol-bugzi...@hotmail.com>
wrote:

> I like this proposal. Specially for `while` loops.
>
> When I want to iterate all matches of a global regex, I always think the
> variable declaration at the top seems ugly
>
> ```js
> let match;
> while (match = regex.exec(string)) {
>   // ...
> }
> ```
>
> This looks better:
>
> ```js
> while (let match = regex.exec(string)) {
>   // ...
> }
> ```
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to