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}
1const numbers = [3, 4, 8, 9, 2];
2let number = 0;
3while (number < numbers.length) {
4 const getNumbers = numbers[number];
5 console.log(getNumbers)
6 number++
7}
8//Expected output:3 4 8 9 2