Object.assign方法
时间: 2023-10-17 16:26:51 浏览: 120
Object.assign()方法是一个对象的静态方法,用于将一个或多个源对象的可枚举属性的值复制到目标对象中,并返回目标对象。该方法实现的是浅拷贝,也就是说目标对象拷贝得到的是源对象的引用。语法为Object.assign(target, ...sources)。该方法可以用于对象属性的合并。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Object.assign详解](https://blog.csdn.net/guxin_duyin/article/details/88916106)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Object.assign()用法小结](https://blog.csdn.net/TurtleOrange/article/details/120563264)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文