Arrow binding

Rick Waldron waldron.rick at gmail.com
Tue Apr 24 13:24:20 PDT 2012


On Tue, Apr 24, 2012 at 4:21 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Rick Waldron wrote:
>
>> I think the colon was just a typo
>>
>
> Dave is not cc'ed and may have missed the responses going back to Tab's
> first one, but I think there was no typo. Dave's example:
>
>    box = {
>        _value: 0,
>        get: () ->  this._value,
>        set(v) { this._value = v }
>    }
>
>
> Yes, it's awkward as examples go because get and set are contextual
> keywords, but this shows them used as plain identifiers. This also shows ->
> as property value in an object literal (for property name 'get'), well as
> method definition shorthand (for 'set'), to contrast the two styles.
>
>
This makes complete sense now, thank you for the clarification.

Rick



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


More information about the es-discuss mailing list