标签:
for (var index in myArray) { // don‘t actually do this
console.log(myArray[index]);
}
缺点:
一般用以下两种:
myArray.forEach(function (value) {
console.log(value);
});
for (var index = 0; index < myArray.length; index++) {
console.log(myArray[index]);
}
标签:
原文地址:http://www.cnblogs.com/attlia/p/4595479.html