>
> 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.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to