> On 25 Feb 2015, at 15:33, Kevin Smith <zenpars...@gmail.com> 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
a...@rauschma.de
rauschma.de



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to