I\'m trying to use some of the more advanced OO features of Javascript, following Doug Crawford\'s \"super constructor\" pattern. However, I don\'t know how to set and get types
In my opinion, in a properly designed type heirarchy, you don't need to know the types of the individual objects. But I seem to be in the minority on that point.
If you must have type identification, make it explicit.
MyClass.prototype.type = "MyClass";
It is reliable and portable, at least for your objects. It also works across contexts. DOM objects are another matter, although you can make things easier for yourself with
window.type = "window";
and so on.
I believe the quote above was written by Douglas Crockford.