Skip to content

Instantly share code, notes, and snippets.

@dejanmarkovic
Created December 16, 2013 17:45
Show Gist options
  • Save dejanmarkovic/7991115 to your computer and use it in GitHub Desktop.
Save dejanmarkovic/7991115 to your computer and use it in GitHub Desktop.
get a size of multi dimensional array
Object.size = function(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment