JS Object.assign() 与 Jquery $.extend()

Object .assign () official links

jQuery.extend () official links

16570490-825e203ce72fbea5.png
Object.assign () method
16570490-5942ca6e3b71d026.png
$ .Extend () method

From the results of the above point of view, two methods are copied object to the target object.

16570490-51a0e34be476efcc.png
$ .Extend () method

16570490-bfec06d6aae0128d.png
image.png

From the results of the above point of view, two methods are shallow copy: If the property is complex hetero element data type, reference copies of the inner element.

Reproduced in: https: //www.jianshu.com/p/49d8b116346a

Guess you like

Origin blog.csdn.net/weixin_33757609/article/details/91058363