So I want to prevent overriding shared keys, when doing a mixin with JS, so we have:
const v = {
a: {
b: {
c: 4,
d: 'str'
}
}
};
console.log(Object.assign({}, v, {a: {b: {c: 5}}}));
this will log:
{ a: { b: { c: 5 } } }
but I am looking for this instead:
{ a: { b: { c: 5, d: 'str' } } }
anyone know how to do this (preferably without a library).