dingzuke / hexo-blog-deploy

服务器部署代码,持续更新中...
https://www.ding51.cn
0 stars 0 forks source link

Object.assign()是深拷贝还是潜拷贝 | Ding Zuke's blog #36

Open dingzuke opened 3 years ago

dingzuke commented 3 years ago

http://www.ding51.cn/object-assign-shi-shen-kao-bei-huan-shi-qian-kao-bei.html

定义Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象分配到目标对象。它将返回目标对象。🌰 var obj = {}; var o1 = { a: 1, b: 1 }; var o2 = { b: 2 }; v