Answer the question
In order to leave comments, you need to log in
Can a method exist before it is written?
Reading
learn.js :
1. Source
The obj[Symbol.toPrimitive](hint) method is called first, if it exists.
Most built-in objects don't have such a valueOf , so numeric and string conversions work the same for them. The exception is the Date object, which supports both types of conversions.
obj[Symbol.toPrimitive](hint)
is executed "under the hood", some objects have this method, some do not. So? valueOf
Most objects do not have a method. And some people have it as St.? That is, I mean, it can be seen in the debugger among the properties?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question