Disadvantage
Augment build-in prototypes under all of the conditions below:
If these three conditions are met, you can proceed with the custom addition to the prototype, following this pattern:
if (typeof Object.protoype.myMethod !== "function") { Object.protoype.myMethod = function () { // implementation... };}
新闻热点
疑难解答