javascript function object's inheritFrom method
- by gawpertron
I've come across this.inheritFrom that enables you to inherit from a super class.
var superClass = function() {
this.foo = 'foo';
this.bar = 'bar';
}
var subClass = function() {
this.inheritFrom = superClass;
this.inheritFrom();
this.myFunction = function() {
return this.foo;
};
}
I've looked in Mozilla and MSDN, but I can't seem to find it documented any where. As far as I can see it works in IE6 and Firefox 3. Any reason why it wouldn't be documented?