for - 循环

for (var i=0;i<cars.length;i++){ 
    document.write(cars[i] );
}
for (var i=0,len=cars.length; i<len; i++){ 
    document.write(cars[i] + "<br>");
}

for/in

var arr={fname:"Bill",lname:"Gates",age:56};  
for (x in arr){  // x 为key
    txt=txt + arr[x];
}

while

while (i<5){ 
    i++;
}

do/while 循环

do{  
    i++;
}while (i<5);