如果‘+’运算符的一个操作数是object,将会自动对object进行object-to-primitive的转换。
‘==’比较运算符与此类似,如果比较一个object和一个primitive类型的变量,将会object-to-primitive。
The object-to-primitive conversion used by + and == includes a special case for Date
objects. The Date class is the only predefined core JavaScript type that defines meaningful
conversions to both strings and numbers. The object-to-primitive conversion is
basically an object-to-number conversion (valueof() first) for all objects that are not
dates, and an object-to-string conversion (toString() first) for Date objects. The conversion
is not exactly the same as those explained above, however: the primitive value
returned by valueOf() or toString() is used directly without being forced to a number
or string.