-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use arrow functions to create class methods with bind operation #48
Comments
This definitely doesn't relate to the bind operator, or to class properties - and I don't see why your last example is "ugly" either. If you'd like to suggest a new change to the language, https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md may be helpful. |
Semantically speaking... arrow functions define functions... not methods of classes. Using the "ugly" way your code smell more like using workaround that a definition solution, strictly speaking |
Strictly speaking, javascript only has functions. Not methods. |
:) Strictly speaking about new ECMAScript standard library sorry Now we support class and methods definitions, static variables,.. using syntactic sugar. I think, make sense we have one way to define methods of class with bind operators |
@Alxandr I'm not sure what you mean by there are no methods. There are functions that bind I would definitely like to see a method syntax for binding scope. The second example above is pretty confusing to read. Is it assigning a global? A local? No, it's assigning a member of the class... The first actually seems to have a consistent interface with the current javascript method syntax with an arrow to indicate lexical binding. |
@mockdeep well, no. There are functions that bind |
Maybe this is out of topic, but still, belongs to bind operator subject.
Why don't use arrow functions operation to create methods of classes with bind operators?
It's the same of:
The text was updated successfully, but these errors were encountered: