deepMerge
Deeply merges two objects, using a function to handle keys present in both.
- Use
Object.keys()to get the keys of both objects, create aSetfrom them and use the spread operator (...) to create an array of all the unique keys. - Use
Array.prototype.reduce()to add each unique key to the object, usingfnto combine the values of the two given objects.