Is it possible to create a named "lambda fat" in typescript?

Using traditional function syntax, you can create inline named functions.

var fn = function myName(arg) {
    // whatever
};
// fn.name === "myName"

      

Is it possible to specify names in typescript using lambda syntax?

var fn = (arg) => {
    // whatever
};
// fn.name not set

      

+3


source to share


1 answer


It doesn't look like you can do that as the spec doesn't cover it, just at the end under the "pending" state "Optional leading identifier for named arrow function expressions."



+2


source







All Articles