SyntaxFix
Write A Post
Hire A Developer
Questions
This should do it:
Object.keys(a).length
However, Object.keys is not supported in IE8 and below, Opera and FF 3.6 and below.
Object.keys
Live demo: http://jsfiddle.net/simevidas/nN84h/