//3种循环 var a = 0; for(var i = 1; i<=100 ; i++){ a = a + i; } document.write(a + "<br/>"); var i = 1; var b = 0; while(i<=100){ b=b+i; i++; } document.write(b + "<br/>"); var i = 0; var c = 0; do{ i++; c=c+i; }while(i<100) document.write(c + "<br/>");