Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var array = ["O","R","D", "E", "R"];
- print ("we start with -->", array);
- array.reverse();
- print("my_array is now reversed -->", array);
- // reversing a reversed array gets back the original
- array.reverse();
- print ("The array is back to its original order -->", array);
- let copy = Array(array.reversed());
- print("The reversed new_array -->", copy);
- print("The original array --> -->", array);
Add Comment
Please, Sign In to add comment