nodejs loop code example
Example 1: for loop in node js
var i;
for (i = 0; i < cars.length; i++) {
text += cars[i] + "<br>";
}
Example 2: 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 3: js for of loop
for (variabile of oggettoIterabile) {
istruzioni
}