The parameter is ignored on the first call. You call the toString method on the Object.prototype object, basically the same way:
{}.toString(); //outputs "[object Object]"
In the second call, you call the toString method for Object , but use the Date object as your context. The method returns the type of the object as a string, compares the toString method of the Date object, which instead returns the value of the Date object as a string.
source share