Skip to content

Instantly share code, notes, and snippets.

@ilearnjavascript
Created March 27, 2019 23:23
Show Gist options
  • Save ilearnjavascript/c6459054d7559f0966257a19765301c6 to your computer and use it in GitHub Desktop.
Save ilearnjavascript/c6459054d7559f0966257a19765301c6 to your computer and use it in GitHub Desktop.
es6 - new methods - 15.js
var obj1 = { a: 1, b: 1, c: 1 };
var obj2 = { b: 2, c: 2 };
var obj3 = { c: 3 };
var mergedObj = Object.assign({}, obj1, obj2, obj3 );
console.log(mergedObj);
// outputs: { a: 1, b: 2, c: 3 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment