With regard to the prototype chain, it is better to have a detailed explanation.

10, what is the correct option?
Let Q=function () {};
Object.prototype.q=function () {};
Function.prototype.p=function () {};
Let q=new Q ();
Alav Q can get Q but not p;
Blav Q can get Q but not p;
CPLV Q can get qMagol p;
DVV Q can get p but not Q;


in js, every function is actually a function object!
as mentioned in the title, Function.p () and Object.q () are obviously callable, while Function.q () can also be called.
so Q is Function,. Both methods can be called directly.
and q=New Q (); q is an Object, so you cannot call p directly. But q.constructor returns Q, so q.constructor.p () is callable.

go back to the question and choose the answer C. although Q can't get p directly, it can be obtained indirectly.

Menu