showing results for - "iterate with do while loops javascript"
Stefania
18 Jan 2017
1var myArray = []
2
3
4
5var i = 0;
6while(i < 5){
7    myArray.push(i)
8    i++
9}
10
11
12console.log(myArray);
Hanae
21 Jun 2016
1var myArray = [];
2
3var i = 10;
4
5 do {  // The do while loop will always run atleast once before checking the condtion. This will return false and break out of the loop.
6	myArray.push(i);
7    i++;
8} while (i < 5)
9
10console.log(i, myArray);