[jQuery] Augmentation of Object.prototype
Hi everyone,
I want to use the code from this page :
http://www.coolpage.com/developer/javascript/Correct%20OOP%20for%20Javascript.html
to enable true inheritance with JavaScript ... but sadly JQuery
doesn't support a such possibility.. Why ?
If you take care by using "hasOwnProperty()" when you iterate to an
object you will never reach my added functions. Like that :
for(var m in o) {
if (m.hasOwnProperty()) {
// use of m..
}
}
Or better with a such augmentation ;o) :
Object.prototype.each = function(f) {
for (var k in this) {
if (this.hasOwnProperty(k)) {
f(k, this[k]);
}
}
};
Is there an explanation of this limitation ?
TIA
/Greg