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

Nathaniel Higgins nat at
Mon Jul 27 13:23:24 UTC 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list