Nah I barely use any object method other than keys. Though took a little bit and came up with this and its probably more of what suzzer was looking for but still O(n) aka brute force right.
Code:
const suzzerMerge2 = (targetObj, newObj) => Object.fromEntries(Object.keys(targetObj).map(targetKeyName => [targetKeyName, newObj[targetKeyName] || targetObj[targetKeyName]]))
There's probably something super clever using Sets to filter out unique key names but um I'm a couple drinks in.
Last edited by Grue; 08-20-2019 at 09:56 PM.