Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let numbers = [1, 2, 3, 4, 5];
- let reversed = [];
- for (let i = 0; i < numbers.length; i++) {
- reversed[i] = numbers[numbers.length - i - 1];
- }
- console.log(reversed);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement