The instruction: " Add the numbers 5 through 0 (inclusive) in descending order to myArray using a while loop."
You should get the following order of numbers:
[5, 4, 3, 2, 1, 0]
At the moment you have the following:
[0, 1, 2, 3, 4]
Declare a variable i and initialize it with a max value, required by the instruction
Change the condition in the ‘while’ loop (i should be greater than or equal to the least number)
The push() method adds the specified elements to the end of an array and returns the new length of the array
Add the numbers 5 through 0 (inclusive) in descending order by changing the i variable - start from the greatest number and add the next (lesser) number (by subtracting i from the previous value, not by using addition i++).
Use the console. log() method ** at the end of the code to output a message to the web console** (to check if the printed result in the console is OK or not):
console.log(myArray);
P.S. Always explain what part of the instruction you do not understand. That way, we can provide a better explanation for the issue in question.