❗️Object.assign copies with getter/setter
⭐ Object.assign()
copies with "get/set" operations, so if:
source object has a getter method, or
target object has a setter method
⭐ they will be invoked❗ during the assignment, not copied❗.
如果沒正確理解這個「複製過程」,可能會產生下列問題:
Last updated