将obj1原型设置为obj2,obj1即可通过原型访对象obj2的属性
var obj1 = {a:"asfssdf",b:121111,c:[1,2,3]};
var obj2 = {d:["sdf",111,"ok"],e:999};
Object.setPrototypeOf(obj1,obj2);//将obj1原型设置为obj2
for(item in obj1){console.log(item)}//a b c d e
将obj1原型设置为obj2,obj1即可通过原型访对象obj2的属性
var obj1 = {a:"asfssdf",b:121111,c:[1,2,3]};
var obj2 = {d:["sdf",111,"ok"],e:999};
Object.setPrototypeOf(obj1,obj2);//将obj1原型设置为obj2
for(item in obj1){console.log(item)}//a b c d e