I have two objects:
const have = {
a: true,
b: {
c: true,
d: true
}
};
const need = {
a: false,
b: {
c: true,
d: false
}
};
I need to find in the "need" obj, if there are at least one positive match (true) with the "have" obj. In this case,they match in b.c, since both are true.
Any ideas how I should face this? maybe first parse to an array? Loop the obj?
Update:
The 'need' obj, does not always contains all the same keys. It might have fewer, but not different.
example:
const need = {
b: {
c: true,
}
};