I\'m using arrow functions in an app and sometimes there is the need to get a reference to the function itself. For normal javascript functions, I can just name them and use
Is there a way to name arrow functions so that a reference can be used from within
Not unless you assign it to a variable. For example:
var foo = () => {
console.log(foo);
}
For arrow functions, I'm currently using arguments.callee
arguments
are not supported by arrow functions. TS currently incorrectly allows you to use them. This will be an error in the next version of typescript. This is to keep typescript arrow functions compatible with the JS Language Specification.
For your use case I would just use a function