for own(...) loop (spin-off from Re: for..in, hasOwnProperty(), and inheritance)

Brendan Eich brendan at mozilla.com
Wed Nov 9 14:15:22 PST 2011


On Nov 9, 2011, at 1:33 PM, Dean Landolt wrote:

>> And if you need to break out of forEach, just, umm, don't use forEach. It's the wrong tool for the job.
> 
> Clearly people like the forEach array extra in conjunction with Object.keys.
> 
> 
> Aye, but I suspect that's because many people don't realize that `some` is a superset of forEach, and IIUC is for exactly this use case. I bet this lack of awareness of the rest of the array extras will be improved with time -- I don't think it lends much support to any argument for fancy new control flow semantics.

Agreed, and I'm not the one making that argument! No goto, no block-lambda for only this case.

The main argument for block-lambdas is shorter function syntax with value-added semantics. Some disagree on the "-added".

/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111109/9f14ad74/attachment.html>


More information about the es-discuss mailing list