I have this array declared. While you can possible tell that I'm playing with Google Maps, the contents of this array are not really important, it's just an array.
var mapData =[{"id":1,"name":"Love.Fish","address":"580 Darling Street, Rozelle, NSW","lat":-33.861034,"lng":151.171936,"type":"restaurant"},{"id":2,"name":"Young Henrys","address":"76 Wilford Street, Newtown, NSW","lat":-33.898113,"lng":151.174469,"type":"bar"},{"id":3,"name":"Hunter Gatherer","address":"Greenwood Plaza, 36 Blue St, North Sydney NSW","lat":-33.840282,"lng":151.207474,"type":"bar"},{"id":4,"name":"The Potting Shed","address":"7A, 2 Huntley Street, Alexandria, NSW","lat":-33.910751,"lng":151.194168,"type":"bar"},{"id":5,"name":"Nomad","address":"16 Foster Street, Surry Hills, NSW","lat":-33.879917,"lng":151.210449,"type":"bar"},{"id":6,"name":"Three Blue Ducks","address":"43 Macpherson Street, Bronte, NSW","lat":-33.906357,"lng":151.263763,"type":"restaurant"},{"id":7,"name":"Single Origin Roasters","address":"60-64 Reservoir Street, Surry Hills, NSW","lat":-33.881123,"lng":151.209656,"type":"restaurant"},{"id":8,"name":"Red Lantern","address":"60 Riley Street, Darlinghurst, NSW","lat":-33.874737,"lng":151.21553,"type":"restaurant"}];
Now later on, I want to get some information out of each of the objects in that array and I do so with a for in loop like so:
for(marker in mapData){
console.log(mapData[marker]);
}
I understand that according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in,
for..in should not be used to iterate over an Array where index order is important.
But I don't really care about the order, so that being the case, are there any disadvantages to iterating over my array with a for in loop?