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"
-> false
typeof masterRecord.data.data[field] == "object"
-> false
(typeof item.data.data[field] == "object" || typeof masterRecord.data.data[field] == "object")
-> false
item.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?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…