Created
October 25, 2011 09:20
-
-
Save roundcorners/1311991 to your computer and use it in GitHub Desktop.
Get an object's length
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = function(obj) { | |
var size = 0, key; | |
for (key in obj) { | |
size++; | |
} | |
return size; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment