Javascript Object addMixin(mixin)
Object.prototype.addMixin = function (mixin) { for (var prop in mixin) { if (mixin.hasOwnProperty(prop)) { this.prototype[prop] = mixin[prop]; }/*from www .j a v a2 s. c o m*/ } };