Proposal: anaphoric if and while syntax

Oriol Bugzilla oriol-bugzilla at hotmail.com
Wed Sep 14 23:20:15 UTC 2016


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)) {
  // ...
}
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160914/e9ef4aaa/attachment-0011.html>


More information about the es-discuss mailing list