function User(name){
this.name=name;
}
function createByObject(obj,...args){
const constructor= Object.getPrototypeOf(obj).constructor;
returnnew constructor(...args);
}
let hd=new User('HDR');
let xj=createByObject(hd,'xj');
xj.show();
posted on
2022-01-28 14:25weakup
阅读(39)
评论(0)
收藏举报