Here you can find the source of size(obj)
Object.size = function(obj){ var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++;//w ww. j a v a 2 s.co m } return size; };
Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; return size; };
Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; return size; };
Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; };
Object.prototype.length=function(){ var l=0; for(var i in this){ if(this.hasOwnProperty(i)){ l++; return l;