This example was all about return in block-lambda returning from enclosing
function (the function f). That's all. Yeah, it was not useful code ;-).
/be
On May 27, 2011, at 9:42 AM, Rick Waldron wrote:
> I have no intention of bike-shedding, but the following example keeps popping
> up:
>
> Arrow Function/Block:
> function f() {
> a.forEach({| | return 3});
> }
>
> ...And I wonder if forEach was _only_ used to illustrate an example of the
> block lambda syntax? If this was meant to serve as an actual representation
> of a real world use case, I would be negligent if I didn't speak up and note
> that the use of "a.forEach({| | return 3});" is incorrect. a.forEach(
> callback ) returns undefined per spec.
>
> Forgive me if I've misunderstood the use of "forEach" in this example.
>
> Rick
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss