2. function object @ Wu Qiong Adam (Sina Weibo) The function object is first an object. Therefore, it also has the _ proto _ link and Delegation. Another special feature of a function object is that it has an attribute called prototype (prototype ?,... SyntaxHighli
2. Function Object)
@ Wu Qiong Adam (Sina Weibo)
Function objects are first an object. Therefore, they also have _ proto _ links and Delegation. Another special feature of a function object is that it has an attribute called prototype (prototype ?, Yes, I have always used the _ proto _ link to represent the prototype linkage mentioned above, so as to avoid confusion ).
When a function is defined using var ff = Function () {}, JS generates a function object whose _ proto _ Pointer Points to the Function. prototype also has a property attribute whose value is an object. Only one property of this object is the constructor. The constructor value is the defined function () {} of this function (){}, the _ proto _ pointer of this Object points to the Object. prototype, for example:
After learning about the function object, let's see how it works: When a function is activated with new, a new object will be created, and its content is the returned result of executing the function, the _ proto _ link of this object points to the prototype attribute object of the function, as shown in the following example:
Abstract:
From column adwu73