-1
爲什麼我們在所有的JavaScript應用程序幾乎用這樣的:爲什麼我們用來檢測物體的類型是函數?
if (typeof Object.create !== 'function') {
Object.create = function(obj) {
function F() {};
F.prototype = obj;
return new F();
};
}
這裏解釋:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create – Christophe