I want to join two objects with functions into a merged object using ES6, not sure how to do this.
For example, I'd like to merge these two objects:
const first = { first: function() { return { type: FIRST }; } }; const second = { second: function() { return { type: SECOND }; } }; Into a new object:
const new = { first: function() { return { type: FIRST }; }, second: function() { return { type: SECOND }; } } What is the best way to do this? I tried Object.assign({}, first, second); but this returned {}.
Any help would be appreciated!