I have this condition in Javascript:
const isObject = (typeof item.data.data[field] == "object" || typeof masterRecord.data.data[field] == "object") && item.data.data[field] != null;
If I use Chrome devTools to step through the code, isObject resolves as true, but this is not correct.
If I insert a breakpoint at the specific line and break down the conditions into its parts, I get the following values:
typeof item.data.data[field] == "object"
-> falsetypeof masterRecord.data.data[field] == "object"
-> false(typeof item.data.data[field] == "object" || typeof masterRecord.data.data[field] == "object")
-> falseitem.data.data[field] != null
-> true
...and finally, the condition as a whole, with its correct output:
(typeof item.data.data[field] == "object" || typeof masterRecord.data.data[field] == "object") && item.data.data[field] != null
-> false
Ideas?