Maizere Pathak.Nepal
Maizere Pathak.Nepal

Reputation: 2411

javascript getOwnPropertyNames method

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

Answers (1)

Ben McCormick
Ben McCormick

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

Related Questions