1let obj1 = { foo: 'bar', x: 42 };
2let obj2 = { foo: 'baz', y: 13 };
3
4let clonedObj = { ...obj1 };
5// Object { foo: "bar", x: 42 }
6
7let mergedObj = { ...obj1, ...obj2 };
8// Object { foo: "baz", x: 42, y: 13 }
1function sum(x, y ,z) {
2 console.log(x + y + z);
3}
4
5const num1 = [1, 3, 4, 5];
6
7sum(...num1); // 8