Throwing StopIteration in array extras to stop the iteration

Jason Orendorff jason.orendorff at gmail.com
Mon Mar 4 15:31:48 PST 2013


On Sun, Mar 3, 2013 at 12:45 PM, David Bruant <bruant.d at gmail.com> wrote:

>         [2, 8, 7].forEach(function(e){
>             if(e === 8)
>                 throw StopIteration;


This would be taking a piece of one low-level protocol, and using it for a
sorta-kinda related thing that actually, on closer inspection, has nothing
to do with that protocol. Array.prototype.forEach doesn't even use
iterators.

-j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130304/784b7868/attachment.html>


More information about the es-discuss mailing list