Posted By

inamorix on 10/23/07


Tagged

js


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rafael


Object.prototype.length (Firefox only)


 / Published in: JavaScript
 

  1. Object.prototype.__defineGetter__('length', function () {
  2. var cnt = 0;
  3. for (var i in this) {
  4. if (this.hasOwnProperty(i)) cnt++;
  5. }
  6. return cnt;
  7. });

Report this snippet  

You need to login to post a comment.