Skip to content

Instantly share code, notes, and snippets.

@alihalabyah
Created October 2, 2014 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alihalabyah/11ebbc1fa7c940303727 to your computer and use it in GitHub Desktop.
Save alihalabyah/11ebbc1fa7c940303727 to your computer and use it in GitHub Desktop.
Count JSON object
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