R
relaxedrob
Howdy All!
I was reading this page:
http://www.crockford.com/javascript/inheritance.html
And it has some code examples:
function Parenizor(value) {
this.setValue(value);
}
Parenizor.method('setValue', function (value) {
this.value = value;
return this;
});
Parenizor.method('getValue', function () {
return this.value;
});
Parenizor.method('toString', function () {
return '(' + this.getValue() + ')';
});
Is this code ok? I am getting errors saying:
Error: Parenizor.method is not a function
And then there are some other examples:
function ZParenizor(value) {
this.setValue(value);
}
ZParenizor.inherits(Parenizor);
ZParenizor.method('toString', function () {
if (this.getValue()) {
return this.uber('toString');
}
return "-0-";
});
I have been checking the ECMAScript spec's .. and there are no
mentions of methods called 'uber' or 'inherits' ...
What am I missing here?
Thanks for any advice!
Rob
I was reading this page:
http://www.crockford.com/javascript/inheritance.html
And it has some code examples:
function Parenizor(value) {
this.setValue(value);
}
Parenizor.method('setValue', function (value) {
this.value = value;
return this;
});
Parenizor.method('getValue', function () {
return this.value;
});
Parenizor.method('toString', function () {
return '(' + this.getValue() + ')';
});
Is this code ok? I am getting errors saying:
Error: Parenizor.method is not a function
And then there are some other examples:
function ZParenizor(value) {
this.setValue(value);
}
ZParenizor.inherits(Parenizor);
ZParenizor.method('toString', function () {
if (this.getValue()) {
return this.uber('toString');
}
return "-0-";
});
I have been checking the ECMAScript spec's .. and there are no
mentions of methods called 'uber' or 'inherits' ...
What am I missing here?
Thanks for any advice!
Rob