Hello people i dont seem to know were im going wrong here. please help

Tell us what’s happening:

**Your code so far**

// Setup
var myArray = [];
// Only change code below this line
var i = 0;
while(i > 5) {
i++;
}
console.log(myArray)
**Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36.

Challenge: Iterate with JavaScript While Loops

Link to the challenge:

Hi @kalololemba

I think your condition in while loop will result in FALSE and it will not run because zero is less than five

i have tried changing it . Its still not running i followed the example exactly the way it is i really dont know what im missing out

you can’t do exactly as the example, the example get the numbers in ascending order (from smaller to greater), you need to have them on descending order (from greater to smaller)

1 Like

still dont get it but thank you.

what’s your new code?

in your first post you are also missing something to put the numbers in the array

You should be decreasing the value of i not incrementing, also you are missing the line of code that will add the value of i to the array so when you console.log(myArray) you will get an empty array.

1 Like