Iterating an object with for..in
is okay, but not an array. Because when you sue for..in
with an array, it will not get the array values, but the array indices. So, you should be doing something like this
for (var key in myObject) {
var currentArray = myObject[key];
for(var i = 0; i < currentArray.length; i += 1) {
console.log(currentArray[i]);
}
}