Functions are also objects. Each of these functions is an instance of a function type and has properties and methods as well as other reference types.
Because a function is an object, the function name is actually a pointer to a function object and is not bound to a function.
1 function sum (NUM1, num2) {2 return NUM1 + num2; 3 }
This is almost the same way as using function expressions to define functions.
1 var function (NUM1, num2) {2 return NUM1 + num2; 3 };
The above code defines the variable sum and initializes it to a function. There are readers who might notice that there is no function name after the functions keyword.
This is because when you use function expressions to define functions, it is not necessary to use function names, which can be referred to by the variable sum.
Also, notice that there is a semicolon at the end of the function, just as you would declare other variables.
Functions are objects, function names are pointers
Because the function name is just a pointer to a function, the function name is no different from the other variables that contain the object pointer.
Note that using the function name without parentheses is to access the function pointer, not the calling function.
[K]js-function Type