3 ms·
May I ask what do you mean by "single arrow function"? Do you mean thin arrow fn(s)?
by notNow 11y ago
May I ask what do you mean by "single arrow function"?
Do you mean thin arrow fn(s)?
- quinnirill 11y agoYes, sorry, thin arrow, not single - `() -> this.foo()` for function expressions and possibly even `let/const fn () -> this.foo()` for declarations.
- notNow 11y agoExcuse my ignorance but I only have experience in JS and not any other "advanced" or well-established programming langs, how's thin arrow syntax gonna fix this prob that fat arrow can't?
- asolove 11y agoFat arrow functions have lexical this: this inside the function is bound to what it was outside. Thin arrow functions have a dynamic this, determined by how they are called. Because the library relies on dynamic this as the place where the data is sent, fat arrow syntax isn't useful with it.
- notNow 11y agoThanks for the explanation.