1. Type(Array.Prototype) evalutes to the string "Prototype"
2. According to the doc, Type(...) "Returns the class name of a value." It follows that "Prototype" must be a class name, and Prototype must be a class.
3. So Type(Prototype) should evalute to "Class". But it doesn't. Instead, an error is thrown ("This variable (=Prototype) has not been assigned a value")
(In all the other cases I've tested, if X is a possible output of Type(), then feeding %X% as input to Type() should evaluate to "Class". The first 6 msgboxes below all say "1", and I expect the 7th to say "1" as well, but it throws an error
Code: Select all
Msgbox(Type(%Type([1,2,3])%)=="Class") ; 1
Msgbox(Type(%Type("123")%)=="Class") ; 1
Msgbox(Type(%Type(56)%)=="Class") ; 1
Msgbox(Type(%Type(Array)%)=="Class") ; 1
Msgbox(Type(%Type(Class)%)=="Class") ; 1
Msgbox(Type(%Type(Type)%)=="Class") ; 1
Msgbox(Type(%Type(Array.Prototype)%)=="Class") ; error
(by the way I was surprised to find out Type(Array.Prototype) doesn't simply evaluate to "Array". I thought a class X's prototype property refers to the "prototypical" or "original" X so to speak, which would be a very special X because all other instances of X are based on it, but not *so* special that it wouldn't even be considered an instance of X (analogy: Adam and Eve are very special instances of Human, but not *so* special that they wouldn't even be instances of Human at all). However on reading the doc more carefully I saw that the prototype of a class is defined as "the object on which all instances of the class are based", not "... all OTHER instances ...", and after thinking a bit I guess it makes sense that the prototype of a class isn't itself an instance of it.)