Skip to content

Instantly share code, notes, and snippets.

@michaelmcshinsky
Last active June 14, 2020 19:46
Show Gist options
  • Save michaelmcshinsky/7e8a22bc58c3e2ec7301f5570568587c to your computer and use it in GitHub Desktop.
Save michaelmcshinsky/7e8a22bc58c3e2ec7301f5570568587c to your computer and use it in GitHub Desktop.
let obj1 = { firstName: 'John', lastName: 'Doe', email: 'johnydoe1@domain.com' };
let obj2 = { email: 'john.doe@domain.com', phone: '012–345–6789' };
let obj3 = { city: 'Salt Lake City', state: 'Utah' }
let newObj = Object.assign({}, obj1, obj2, obj3);
// {
// firstName: 'John',
// lastName: 'Doe',
// email: 'john.doe@email.com',
// phone: '012–345–6789',
// city: 'Salt Lake City',
// state: 'Utah'
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment