Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakyra/420f14355a212bacb6de05b5219c59d9 to your computer and use it in GitHub Desktop.
Save shakyra/420f14355a212bacb6de05b5219c59d9 to your computer and use it in GitHub Desktop.
Using a loop to reverse an array
var toDoList = ["Take out garbage", "Pay bills", "Cross off finished items"]
for _ in toDoList {
toDoList.reverse()
print(toDoList)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment