Since we're discussing arrow functions and syntax...

Michael Rosefield rosyatrandom at gmail.com
Tue Oct 24 17:28:33 UTC 2017


I like arrow functions, and sometimes the only reason I don't use them is
because I need this-binding.

So I, personally would like a variant that uses the CoffeeScript -> syntax
that is precisely like => except that it uses traditional this-binding. The
only 2 issues I can see are:

* adding more syntax to the language
* could the concise form bind this? Would, say `const foo = obj ->
Object.assign(obj, this.bar)` work, if then used, say, as follows: `const
baz = { bar: { /*whatever*/ } }; foo.call(baz, { /* something */ })`
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171024/5d68d7ae/attachment.html>


More information about the es-discuss mailing list