Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object.assign vs lodash _.assign

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?

like image 529
sfletche Avatar asked May 09 '16 18:05

sfletche


1 Answers

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

like image 197
omarjmh Avatar answered Oct 28 '22 00:10

omarjmh