Kevin Smith wrote:
The most bang for the buck, as I see it, is in this form:

(x, y) => { FunctionBody }

If => means bound-this, I agree this has a lot of bang/buck. Not clear the b/b beats the expression-body case, though. More below.

If we have implicit return (which I think we can bundle in with the "=> is different" meme), then we have a sufficiently succinct alternative:

(x, y) => { { p:x * y} }

I don't know about implicit return. TC39 wants to avoid it in anything that looks like a function (body). Does the => distinguish this case enough? Consider a large body-block.

I think (x, y) => expr can be difficult for human readers (particularly non-experienced readers) to figure out anyway.

The sweet spot looking at PrototypeJS is a single expression body. There are some longer inject funargs but they are the minority AFAICS.

Surveying other libraries would be helpful.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to