var myObj = { 1: { 44: ['18', 'anna'], 55: ['19', 'ina'], 66: ['19', 'dina'] }, 2: { 11: ['21', 'maria'], 33: ['20', 'olga'] } }; function object_counter(obj) { var count = 0; $.each(obj, function(){ ++count; }); return count; }; var cnt = object_counter(myObj); // cnt is 2
No comments:
Post a Comment