Check for "constructor" property on the object. It is Array - it is an array object.
var a = {
'b':{length:0},
'c':[1,2]
}
if (a.c.constructor == Array)
for (var i = 0; i < a.c.length; i++)
alert(a.c[i]);
else
for (var s in a.b);
alert(a.b[s]);
A more practical and precise term than object or hash or dictionary may be associative array. Object could apply to many undesirables, e.g. typeof null === 'object' or [1,2,3] instanceof Object. The following two functions work since ES3 and are mutually exclusive.