The object to be converted into a string
A string representation of the object
objToString(new Date()); // [object Date]
objToString(new String()); // [object String]
// Math has its Symbol.toStringTag
objToString(Math); // [object Math]
objToString(undefined); // [object Undefined]
objToString(null); // [object Null]
The
objToString()
method returns a string representing the object. This explicitly always calls theObject.prototype.toString()
method.An object's toString() method is most commonly invoked when that object undergoes: