Created
October 2, 2014 10:20
-
-
Save alihalabyah/11ebbc1fa7c940303727 to your computer and use it in GitHub Desktop.
Count JSON object
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
function countProperties(obj) { | |
var prop; | |
var propCount = 0; | |
for (prop in obj) { | |
propCount++; | |
} | |
return propCount; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment