Arrow functions is evil. It's just adding more complication reading js code those days. I'll stick to constructor. However it's not old because you use arrow functions. Function != Arrows functions.
Using arrow functions for members defined that way allows for this to remain scoped to the instance of the class / object. It is possible to define it as handleChange = function () { ... }, but then you would need the constructor to bind handleChange to the instance.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Arrow functions is evil. It's just adding more complication reading js code those days. I'll stick to constructor. However it's not old because you use arrow functions. Function != Arrows functions.
I understand, but disagree. Arrow functions are good friends in nowadays.
I think
functionis likevaronly to be used in legacy cases.let,constand=>are much more predictable.Using arrow functions for members defined that way allows for
thisto remain scoped to the instance of the class / object. It is possible to define it ashandleChange = function () { ... }, but then you would need the constructor to bindhandleChangeto the instance.