I'm stuck ? Iterate with JavaScript While Loops

via the iteration with javaScript while loops
THE QUESTION AS FOLLOW
Add the numbers 5 through 0 (inclusive) in descending order to myArray using a while loop.

Run the TestsReset All Code

Get Help

You should be using a while loop for this.

myArray should equal [5,4,3,2,1,0] .

AND MY CODE LOOK LIKE:

var myArray = [];
var i = 0;
while (i < 5) {
    myArray.push(i);
    i++;
}
console.log(myArray);

and when i press enter key automatically the whole web page went offline :thinking:

It shouldn’t have an issue with an infinite loop
but try the code line by line on paper, write down the value of each thing after each line, to see exactly what’s going on and what’s the result