The name
property tries to provide a useful name for a function
GIVEN a function declaration
WHEN reading the name
property THEN it is the name of the function
GIVEN a function expression
WHEN reading the name
THEN it is the name of the variable holding the function
WHEN assigning the function to a different variable THEN the name stays the initial variable's name
WHEN reading the name
THEN it is the name of the variable holding the function
special cases
WHEN binding a function THEN the bound-function's name gets prefixed with "bound"
WHEN creating a new Function
instance THEN the name is "anonymous"
WHEN reading the name of a getter THEN it is prefixed with "get"
WHEN reading the name of a setter THEN it is prefixed with "set"
Links
The specification text, this property was introduced with this version of JavaScript.
The MDN pages describing this property, easy to read with examples.