Reputation: 2411
why dont Object.getOwnPropertyNames() not return call and apply method of the function?
function arr(){};
Object.getOwnPropertyNames(arr);//output:arguments,length,prototype,caller only
Upvotes: 0
Views: 62
Reputation: 25728
Because those properties are on the Function
prototype, not on the function itself. Thats actually the whole point of the method, to filter out properties that are on the prototype and not on the object itself.
Upvotes: 2