Ranges

Andrea Giammarchi andrea.giammarchi at gmail.com
Fri Nov 4 17:39:14 UTC 2016


FWIW: got bitten from same thing too ... the fact `for(const x of ...)`
works would always mislead me to think a `for(const i; ... i++)` would too,
even if it's completely different meaning/issue/matter.

Oh well

On Fri, Nov 4, 2016 at 5:34 PM, Mathias Bynens <mathias at qiwi.be> wrote:

> On Fri, Nov 4, 2016 at 6:24 PM, Jordan Harband <ljharb at gmail.com> wrote:
> > Here you go:
> >
> > 1) `function* range(start, end) { for (const i = +start; i < end; ++i) {
> > yield i; } }`
>
> For future reference: `++i` throws when `i` is a `const` binding. The
> intended example uses `let` instead.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20161104/e338f984/attachment.html>


More information about the es-discuss mailing list