1var i=0;
2while (i < 10) {
3 console.log(i);
4 i++;
5}
6//Alternatively, You could break out of a loop like so:
7var i=0;
8while(true){
9 i++;
10 if(i===3){
11 break;
12 }
13}
1 var i = 1;
2 var msg = '';
3
4 while(i < 10) {
5 msg += i + ' x 5 = ' + (i + 5) + '<br />';
6 i++;
7 }
8
9 document.getElementById('answer').innerHTML = msg;