function object(o) {
function F() {}
F.prototype = o;
return new F();
}
var mm = object({name:'123'});
let animal = {
eats: true
};
let rabbit = Object.create(animal);
console控制台打印
function object(o) {
function F() {}
F.prototype = o;
return new F();
}
var mm = object({name:'123'});
let animal = {
eats: true
};
let rabbit = Object.create(animal);
console控制台打印