Use for loop when you now the number of items before looping it. For example looping via elements of an array or array-like object:
var items = [];
....
for(var i = 0; i < items.length; i++){
...
}
If you iterate via fields of some object you may use the following form of for loop:
var obj = {};
...
for(var field in object){
//access each value as object.field
}
while-loop, is used, when you don't know the term when loop is finished.
do-while loop use also when you don't know the term when loop is finished but you need to iterate at least one time
Compare:
do{
//do something, then check the term
}while(check the term)
vs.
while(check the term){
//do something
}
PS: there is a form of for loop - so called foreach, but i'm not sure it is standard, so I don't use it yet.