Skip to content

Instantly share code, notes, and snippets.

@lucasmezencio
Created June 27, 2012 12:20
Show Gist options
  • Save lucasmezencio/3003713 to your computer and use it in GitHub Desktop.
Save lucasmezencio/3003713 to your computer and use it in GitHub Desktop.
Get size/count/length of an object in JavaScript
var obj = {
attr : 'some string',
attr1 : 'some other string'
}
var objSize = Object.keys(obj).length;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment