Object.assign vs lodash _.assign

sfletche picture sfletche · May 9, 2016 · Viewed 18.8k times · Source

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?

Answer

omarjmh picture omarjmh · May 10, 2016

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