Syntax shortcut for accessing properties on the current context ("this")

Andrea Giammarchi andrea.giammarchi at gmail.com
Mon Jul 27 13:46:33 UTC 2015


apparently the @ has been booked already for decorators
https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841

I also personally think we don't really need yet another magic shortcut
that but that's just my opinion.

Best Regards

On Mon, Jul 27, 2015 at 2:23 PM, Nathaniel Higgins <nat at nath.is> wrote:

> Hi.
>
> In CoffeeScript (and a few other languages including Ruby I believe),
> there is a syntax shortcut for simplifying accessing properties on the
> current context (this variable), which is something you have to do often.
>
> This looks something like `@prop`, which is synonymous with `this.prop`.
> I’m not sure if the “@“ character is used for anything else yet in
> JavaScript, but I’m sure we could find another character to do the same if
> it is.
>
> --
> Nathaniel Higgins
> Sent with Airmail
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150727/2ee5f8ea/attachment.html>


More information about the es-discuss mailing list