how to loop to write in node js code example Example: for loop in node js var i; for (i = 0; i < cars.length; i++) { text += cars[i] + "<br>"; }