if (typeof Object.create !== 'function') {
Object.create = function (o) {
function F() {}
F.prototype = o;
return new F();
};
}
var o1 = {};
o1.init = function(){
a
我是新來的原型繼承,所以我試圖理解'正確'的方式。我想我能做到這一點: if (typeof Object.create !== 'function') {
Object.create = function (o) {
function F() {}
F.prototype = o;
return new F();
};
}
var t
如何繼承Object.create()?我嘗試了這些,但都不是工作: var B = function() {};
var A = function() {};
A = Object.create(B);
A.prototype.C = function() {};
和 var B = function() {};
var A = function() {};
A.prototype