The interpreter tries to convert the object to a primitive.
The object does not have a [Symbol.ToPrimitive]
method, so the toString
method is called.
It doesn't matter that the name of this method has the word String
. What matters is what it returns.
As a result, it turned out: