Use $.each() instead of for(in) loop on Array's

for(in) is used to loop trough the properties of an object. for(;;) is
what you want for Array's. $.each() is smart enough to handle both.

Bug: 47771
Change-Id: I583dbb8e196b7b87137ac9de2c4747d1e99405fc