const user = {
name: 'Kapil Raghuwanshi',
gender: 'Male'
};
const college = {
primary: 'Mani Primary School',
secondary: 'Lass Secondary School'
};
const skills = {
programming: 'Extreme',
swimming: 'Average',
sleeping: 'Pro'
};
const summary = { ...user, ...college, ...skills };
console.log(summary);
结果:
- gender: "Male"
- name: "Kapil Raghuwanshi"
- primary: "Mani Primary School"
- programming: "Extreme"
- secondary: "Lass Secondary School"
- sleeping: "Pro"
- swimming: "Average"