The prototype object property is automatically created, it's just an empty object with the attributes of the {DontEnum} and {DontDelete} , you can see how function objects are created in the specification:
Pay attention to steps 9, 10 and 11:
9) Create a new object that will be created by the expression new Object() .
10) Set the property of the Result (9) constructor to F. This property has the { DontEnum } attributes.
11) Set the prototype property F for the result (9). This property has the attributes specified in 15.3.5.2 .
You can see that this is true:
function f(){ //... } f.hasOwnProperty('prototype'); // true, property exist on f f.propertyIsEnumerable('prototype'); // false, because the { DontEnum } attribute delete f.prototype; // false, because the { DontDelete } attribute
CMS
source share