Last updated 2 years ago
Was this helpful?
JS โฉ value โฉ type โฉ conversion โฉ object -> primitive โฉ prefer-string
prefer-string๏ผpreferring a string (if conversion is possible)
โ "prefer-string" may result in โ๏ธ TypeErrorโ
JavaScript: The Definitive Guide โฉ
3.9.2 Explicit Conversions
3.9.3 Object to Primitive Conversions
14.4.7
Object.prototype.toString() - object to string.
Object.prototype.valueOf() - object to (primitive) value, if exists.