Open giorgioGTelian opened 1 year ago
Just a question, do you think the code will execute when i = -1?
if you write let i = -1
the output will be [5, 4, 3, 2, 1, 0, -1]
so our Array will begin at -1 inclusive.
this is the complete code with the change you suggested
const myArray = []; // Only change code below this line let i = -1; while (i < 6) { myArray.push(i); i++; } // Only change code below this line. myArray.reverse(myArray); console.log(myArray);
They changed the exercise! (again)