Solution · code-edit

destructuring 與 spread copy

對照完整答案、責任邊界與原因。

本階段驗收

頁面不會替你修改檔案;請在實作檔完成後重新整理確認。

目前要處理

只有原始 service,尚無副本。

預期看到

copy!==original、original.price=1000、copy.price=1200、id/name 正確。

const {id,name}=service; const copy={...service,price:1200}。

檔案清單

只在本階段資料夾內操作,避免改到其他章節。

證據:sameReference=false、原價1000、副本1200

回到主題說明