Last active
May 31, 2016 02:07
-
-
Save akuraru/7388c5f93080d38f3d96749bae820325 to your computer and use it in GitHub Desktop.
Arrayを逆順に評価する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let array = [1, 2, 3, 4, 5] | |
for num in array.reverse() { | |
print("num: \(num)"); | |
} | |
for (index, num) in array.enumerate().reverse() { | |
print("num: \(num)"); | |
print("inde: \(index)\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment