Skip to content

Conversation

@giorgioGTelian
Copy link

They changed the exercise! (again)

They changed the exercise! (again)
@Ajackwere
Copy link

Just a question, do you think the code will execute when i = -1?

@giorgioGTelian
Copy link
Author

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants