Tell us what’s happening:
I have followed the steps and believe i did everything right. However its still not returning the string {5,4,3,2,1,0] can someone help me figure out what i am doing wrong please. I keep getting just one number for an answer.
Your code so far
// Setup
const myArray = [];
// Only change code below this line
let i = 5;
while (i < 0) {
myArray.push(i);
i--;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Iterate with JavaScript While Loops
Link to the challenge: