Multiple Ways to Use For Loops with Arrays and Object Literals in JavaScript
Posted on July 6, 2015 in JavaScript by Matt Jennings
var myArr = [1, 4, -9, -5, 5, 2];
for(index in myArr) {
console.log(myArr[index]);
}
/*
Displays:
1
4
-9
-5
5
2
*/
// The object key names must be …