As Fernando said, why not just use an array of objects if you are
about the length?
Also, can the config object contain things that are not objects?

in ES5, you can do Object.keys(config).length as Object.keys returns
an array of the keys of the object.

If it is not homogenous, you can do something like

var p, size = 0;
for(p in config)
  if( typeof config[p] == "object")
    size++;
size;

Of course, you'll want to double check for arrays as well.

-- 
Gary Katsevman
Computer Science Undergraduate
Northeastern University
gkatsev.com

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to