const list = [1,1,2,3,5]; const bigger_list = [...list, 8, 13]; // [1, 1, 2, 3, 5, 8, 13];
const fn = (x, y, z) => x + y + z; fn(bigger_list); // "1,1,2,3,5,8,13undefinedundefined" ([1,1,2,3,5,8,13] + undefined + undefined) fn(...bigger_list); // 4 (1 + 1 + 2)
const src = { foo: "bar" }; const cpy = { ...src }; // { foo: "bar" } const tgt = { ...src, bar: "foo" } // { foo: "bar", bar: "foo" }