The function name is an important bit of information, especially for debugging. But, how is it determined in arrow function syntax?
For normal functions, function name is clearly stated in function declarations:
function doSomething() {
// body code
}
Even for function expressions, you can supply a function name to make debugging easier:
var f = function doSomething() {
// body code
};
Arrow functions do not use the function keyword and you cannot include a function name. But since they are essentially used in expressions, the left-hand side variable name is assigned to the resultant function as the function's name property.
let doSomething = () => {
// body code
};
This is the standard behavior according to the specification.