Last active
August 29, 2015 14:19
-
-
Save mzaks/6b6a8ddd21ef473a5b2c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 list = 1 => 2 => 3 => nil | |
| println("\(list.value)") //1 | |
| for value in list { | |
| println(value) // 1 2 3 | |
| } | |
| let l1 = list[0] | |
| let l2 = list[5] | |
| let l3 = list[2] | |
| let l4 = list[1]?[1] | |
| println(l1?.value) // Optional(1) | |
| println(l2?.value) // nil | |
| println(l3?.value) // Optional(3) | |
| println(l4?.value) // Optional(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment