Guest User

Untitled

a guest
Jan 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. var array = ["O","R","D", "E", "R"];
  2. print ("we start with -->", array);
  3. array.reverse();
  4. print("my_array is now reversed -->", array);
  5. // reversing a reversed array gets back the original
  6. array.reverse();
  7. print ("The array is back to its original order -->", array);
  8.  
  9. let copy = Array(array.reversed());
  10.  
  11. print("The reversed new_array -->", copy);
  12. print("The original array --> -->", array);
Add Comment
Please, Sign In to add comment