Object.assign vs lodash _.assign

ぃ、小莉子 提交于 2019-12-21 07:12:19

问题


Looking at the documentation for ES6 Object.assign and Lodash _.assign it looks like these function in exactly the same way.

Is that a correct understanding? Or am I missing something?


回答1:


Depends on the browser. Per the lodash docs:

Made _.assign use built-in Object.assign when available.

You can go here for browser support:

Basically, IE doesn't have support so lodash's code is used in that case

MDN Docs on Object.assign



来源:https://stackoverflow.com/questions/37123425/object-assign-vs-lodash-assign

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!