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 = numbers.length - 1; i >= 0; i--) {
- reversed.push(numbers[i]);
- }
- console.log(reversed);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement