Questions about javascript functions and objects?

Today, we look at the problems encountered in the authoritative Guide to javascript, which describes that there is a subtle difference between functions and "executable object (callable object)" in Javascript. All functions are executable, but an object can also be executable and can be called like a function, but it is not a real function.

what is "executable object"?

Jul.09,2021

is essentially an object. The function can be called directly by adding (), and the object cannot be called until it implements _ _ call__. A function is a special object.


personal opinions:
for example, Object is an object, which he can use directly, such as Object.toString () , or can be called like a function, such as new Object () , or Object () .
but the ordinary object var obj = {}; obj () = > Uncaught TypeError: obj is not a function


everything is an object in js, but the function is a first-class citizen, although it can be passed as a parameter,

Menu