function SuperClass()
{
var self = this;
self.someVariable = true;
}
function SubClass()
{
var self = this;
self.name = "Sub";
}
SubClass.prototype = SuperClass;
var sub = new SubClass();
alert("This is a sub class with name " + sub.name + " and variable " + sub.someVariable);
</script>
</head>
<body>
</body>
</html>
output:
This is a sub class with name Sub and variable undefined
So how come sub class doesnt have someVariable? I thought thats the whole point of prototyping.