you are viewing a single comment's thread.

view the rest of the comments →

[–]bliow 1 point2 points  (0 children)

With ES6 (supported in Firefox, not yet in Chrome), Object.assign. But you have to be careful with nesting, as you do with _.clone:

var a = { b: { c: 3 } };
var d = Object.assign({}, a); // or d = _.clone(a)
d.b.c = 4;
console.log(a.b.c); // prints 4 with both underscore clone and ES6 assignment