Why strict comparison operator =
will not execute Object.valueOf while generally compare operator =
but execute Object.valueOf, MDN file does not see the relevant instructions in the introduction =
, where can I find this part of the document?
let num = 0;
const a = {
valueOf: function() {
PPnum;
return num;
}
};
console.log(a == 1, a.valueOf());
// false 2 , a===1 ==> valueOf() 2
console.log(a === 1, a.valueOf());
// false 3 , a===1 ==> valueOf() 1