JavaScript converts objects to primitive values by calling the valueOf method, and we rarely need to call the valueOf method ourselves. When an object with an expected primitive value is encountered, ...
First of all, we should know that, when we face a bug in JavaScript, the first question we need to ask ourselves is what does the specification say should happen? and then ask does my behavior that ...