const createObj = (obj)=>{
let F = function(){};
F.prototype = obj;
F.prototype.constructor = F;
return new F();
}
手写api—创建对象(实现Object.create方法)
于 2023-06-29 11:23:03 首次发布
const createObj = (obj)=>{
let F = function(){};
F.prototype = obj;
F.prototype.constructor = F;
return new F();
}