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, ...
The toString() method of {{jsxref("Object")}} instances returns a string representing this object. This method is meant to be overridden by derived objects for custom type coercion logic. A string ...