> On 25 Feb 2015, at 15:33, Kevin Smith <[email protected]> wrote: > > OK. I see the use case for `throw()` (e.g. to convert a promise rejection > into an exception when using generators for async). The only use case for > `return()` is closing an iterator, then(?) > > Or for closing a data sink, if you're using a generator that way. > > In particular, "return" is called on an iterable in the event of an early > exit from a for-of loop, in order to allow the iterable to release resources > or perform other cleanup.
Right (also: destructuring, spread, etc.). I was mainly wondering whether there was any other use case for `return()`. Axel -- Dr. Axel Rauschmayer [email protected] rauschma.de
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

