×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Massimo Zappino
Added: Jul 14, 2011 3:25 PM
Modified: Jul 5, 2012 9:49 AM
Views: 126
  1. var count = 0;
  2. for (var k in myobj) if (myobj.hasOwnProperty(k)) count++;
  3.  
  4.  
  5. // It does not work on all browsers
  6. Object.keys(obj).length