Where y
is an array of objects,
y = [
{property:"",property2:""},
{property:"",property2:""},
{property:"",property2:""},
{property:"",property2:""},
{property:"",property2:""}
]
could someone please tell me why,
for (x in y) {
console.log(x[y].property);
}
is so many times slower than,
for (i = 0; i < y.length; i++) {
console.log(x[y].property);
}