different ways to do a for loop js code example Example: for loop javascript var i; for (i = 0; i < cars.length; i++) { text += cars[i] + "<br>"; }