Merge Collection (array of objects)
const collection = [
{ name: 'Joe' },
{ age: 31 },
{ job: 'programmer' }
];
const merged = Object.assign({}, ...collection);
console.log(merged);
Combine (“assign”) entire array of objects.
Saw this here… figured it was worth a quick post.