Object.size = function(obj) { var size = 0; var key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; }; // Get the size of an objectvar size = Object.size(myArray);
-
近期文章
分類
其它
彙整
近期迴響
Object.size = function(obj) { var size = 0; var key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; }; // Get the size of an objectvar size = Object.size(myArray);