Faulty course ,I'm not able to advance

**its not giving me the pass,even though I’m getting the required answer
Describe your issue in detail here.

  **Your code so far**

// Setup
var myArray = [];

// Only change code below this line
var i = 0;
while(i < 5) {
myArray.push(i);
i++;
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Linux; Android 8.1.0; Lenovo TB-8704X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Safari/537.36

Challenge: Iterate with JavaScript While Loops

Link to the challenge:

Your code is in fact faulty.

// Setup
var myArray = [];

// Only change code below this line
var i = 0;
while(i < 5) {
  myArray.push(i);
  i++;
}

console.log(myArray);

If you look at the contents of myArray, you have [ 0, 1, 2, 3, 4 ], but you are supposed to have [5,4,3,2,1,0].

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.