все эти ответы верны, но, возможно, вы увидите это лучше с исправленным примером:
var x = {};
x.a = {y:5};
x.b = {z:6};
for (prop in x) console.log(typeof prop); // returns "string"
for (prop in x) console.log(prop); // returns "a", then "b"
for (prop in x) console.log(typeof x[prop]); // returns "object"
for (prop in x) console.log(x[prop]); // returns {y:5}, then {z:6}