JavaScriptのObject.creat()とnew()

227 ワード

Object.create = function (obj) {
  function F() {}
  F.prototype = obj;
  return new F();
};
varobj = {};obj.__proto__ = Base.prototype;Base.call(obj);