for in loops array code example
Example 1: Iterate with JavaScript For Loops
var myArray = [];
for (var i = 1; i <= 5; i++){
myArray.push(i);
}
console.log(myArray) // console output [ 1, 2, 3, 4, 5 ]
Example 2: js for of loop
for (variabile of oggettoIterabile) {
istruzioni
}