monkeys.js 308 B

123456789101112131415161718
  1. Object.defineProperty(Array.prototype, 'setProperty', {
  2. enumerable: false,
  3. configurable: false,
  4. writable: false,
  5. value: function(prop, value) {
  6. var len = this.length;
  7. for(var i = 0; i < len; i++) {
  8. if(typeof this[i] != 'object') continue;
  9. this[i][prop] = value;
  10. }
  11. return this;
  12. }
  13. });