The typeof operator will always return a string , which largely does not match the table. You should be able to do something like this. Although I really don't see how this adds value to a system like JavaScript.
function Base() { } function Sub() { } function Inherit(base, sub) { sub.prototype = new base(); } Inherit(Base, Sub);
source share