|
|
|
|
|
by martin-adams
3137 days ago
|
|
My understanding is that arrow functions aren’t used as part of a class definition, but for things like anonymous functions in callbacks, preserving the ‘this’ context when something else is invoking it. E.g.
el.onClick((e) => {this.doSomething();}); In that case something else will invoke the onClick callback but we want the ‘this’ context to the same as when we set up the onClick. |
|