Tell us what’s happening:
why is this not working?
Your code so far
var myArray = [];
var i = 0;
while(i < 5) {
myArray.push(i);
i++;
}
console.log(myArray);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
.
Challenge: Iterate with JavaScript While Loops
Link to the challenge: