I don\'t know why I never asked myself that questioned the last years before, but suddenly I could not find any answer for myself or with google.
Javascript is known
The only useful line I can find in the ES5 spec is this:
Within this specification, the notation “Type(x)” is used as shorthand for “the type of x” where “type” refers to the ECMAScript language and specification types defined in this clause.
I assume that when the runtime needs to perform an operation that needs to know the type of some value, it will check that value against the grammar defined in the spec for each type, until it finds a match.
For example, the grammer for a boolean literal is as follows:
BooleanLiteral ::
true false
If the value is exactly true or exactly false (e.g. with no quotes) then that value is of type boolean.