Is there a way to copy an object with lodash, but not all properties. The only way I know is to manually copy its property by property
required, for example:
var obj = { a: 'name', b: [1,2,3], c: { z: 'surname', x: [] }, d: { y: 'surname2', w: [] } };
and the result will look like
var copy_obj = { b: [1,2,3], c: { z: 'surname', x: [] } };
Edit: I finally decided:
var blacklist = ['a','d']; _.cloneDeep(_.omit(obj, blacklist));
source share