//將多個對象合併到一個對象裏 const input = { a: 1, b: 2 } const test = { d: 5 } const output = { ...input, ...test, c: 3 } //拆解對象,獲取想要的屬性 const input = { a: 1, b: 2, c: 3, d: 4, e: 5 } const { a, b, ...rest } = input console.log(a,b,rest)