Skip to content

Instantly share code, notes, and snippets.

@ahmehri
Created May 26, 2018 16:41
Show Gist options
  • Save ahmehri/16cae26bc62a1bfaf04a57ba4658c5eb to your computer and use it in GitHub Desktop.
Save ahmehri/16cae26bc62a1bfaf04a57ba4658c5eb to your computer and use it in GitHub Desktop.
const _ = require('lodash');
const obj1 = { entities: { jobs: { 1: 1 }, source: 'obj1' } };
const obj2 = { entities: { jobs: { 1: 3 } }};
const merge = { ...obj1, ...obj2};
merge
const mergeWithLodash = _.merge({}, obj1, obj2);
mergeWithLodash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment